Skip to content

Fix accidental mangling of model namespace name#1200

Merged
jgabry merged 2 commits into
masterfrom
model-names
Jul 8, 2026
Merged

Fix accidental mangling of model namespace name#1200
jgabry merged 2 commits into
masterfrom
model-names

Conversation

@andrjohns

@andrjohns andrjohns commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

Related to #1197, the model name argument is currently passed to stanc as a quoted string (i.e., stanc --name='bernoulli_model'), causing stanc to treat the quotes as part of the model name and escape/mangle them in the generated c++ (e.g., x39bernoulli_modelx39_namespace).

Additionally the pre-processing step for replacing spaces with underscores to generate the model name from filename is currently using the sub() function instead of gsub(), causing only the first space to be replaced (i.e., name with spaces.stan -> name_with spaces)

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@codecov-commenter

codecov-commenter commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.08%. Comparing base (d67fd53) to head (b9a0c28).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1200      +/-   ##
==========================================
- Coverage   91.10%   91.08%   -0.02%     
==========================================
  Files          15       15              
  Lines        6125     6127       +2     
==========================================
+ Hits         5580     5581       +1     
- Misses        545      546       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jgabry jgabry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Will merge now

@jgabry jgabry merged commit 8b056f5 into master Jul 8, 2026
14 checks passed
@jgabry jgabry deleted the model-names branch July 8, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants