Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Stan Parser #246

Merged
merged 7 commits into from
Nov 9, 2023
Merged

Improve Stan Parser #246

merged 7 commits into from
Nov 9, 2023

Conversation

gowerc
Copy link
Collaborator

@gowerc gowerc commented Nov 8, 2023

Closes #97

@danielinteractive

  • As discussed in the issue the code has been altered to improve error handling for known problem cases (1-line blocks)
  • I started the "extending jmpost" vignette which provides details of our rules for Stan file formatting
  • Fixed a bug with the StanModule print message that was displaying spurious blocks (I separated this into its own commit if you want to review that independently).
  • There were also a couple of minor / edge case bug fixes to the parser around how it handles whitespace on the closing } (e.g. just made the regex more robust)
  • Heavily commented the function as its pretty difficult to understand by skimming the code alone.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Unit Tests Summary

    1 files    34 suites   1m 56s ⏱️
  98 tests   74 ✔️ 24 💤 0
337 runs  313 ✔️ 24 💤 0

Results for commit d57f738.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

badge

Code Coverage Summary

Filename                       Stmts    Miss  Cover    Missing
---------------------------  -------  ------  -------  ---------------------------
R/brier_score.R                  166       0  100.00%
R/DataJoint.R                     76       2  97.37%   264, 270
R/DataLongitudinal.R             119       1  99.16%   245
R/DataSubject.R                   69       1  98.55%   124
R/DataSurvival.R                  74       1  98.65%   146
R/defaults.R                      13       7  46.15%   27, 45-84, 111
R/generics.R                      16       1  93.75%   69
R/JointModel.R                    91       8  91.21%   113-125, 204, 210, 216
R/JointModelSamples.R             54       0  100.00%
R/Link.R                          18       0  100.00%
R/LinkGSF.R                       69      13  81.16%   116-128
R/LinkNone.R                       5       1  80.00%   36
R/LinkRandomSlope.R               11       0  100.00%
R/LongitudinalGSF.R               24       0  100.00%
R/LongitudinalModel.R             17       0  100.00%
R/LongitudinalQuantities.R        85       8  90.59%   100-107
R/LongitudinalRandomSlope.R       22       0  100.00%
R/Parameter.R                     14       0  100.00%
R/ParameterList.R                 37       1  97.30%   175
R/Prior.R                        117       0  100.00%
R/Quantities.R                   105       0  100.00%
R/simulations_gsf.R               43       0  100.00%
R/simulations_os.R                11       5  54.55%   35-39
R/simulations_rs.R                21       0  100.00%
R/simulations.R                   99       1  98.99%   122
R/StanModel.R                     14       0  100.00%
R/StanModule.R                   175       6  96.57%   197-198, 240, 251, 386, 414
R/SurvivalExponential.R           10       0  100.00%
R/SurvivalLoglogistic.R           11       0  100.00%
R/SurvivalModel.R                 19       0  100.00%
R/SurvivalQuantities.R           151       6  96.03%   173-178
R/SurvivalWeibullPH.R             11       0  100.00%
R/utilities.R                    145       1  99.31%   13
R/zzz.R                           11      11  0.00%    4-29
TOTAL                           1923      74  96.15%

Diff against main

Filename          Stmts    Miss  Cover
--------------  -------  ------  -------
R/StanModule.R      +17      +2  -0.90%
TOTAL               +17      +2  -0.07%

Results for commit: d57f738

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Collaborator

@danielinteractive danielinteractive left a comment

Choose a reason for hiding this comment

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

Thanks @gowerc , looks very good!

vignettes/extending-jmpost.Rmd Outdated Show resolved Hide resolved
vignettes/extending-jmpost.Rmd Outdated Show resolved Hide resolved
@gowerc gowerc merged commit 29ba914 into main Nov 9, 2023
@gowerc gowerc deleted the feature/improve-stan-parser branch November 9, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Improve Stan code parser
2 participants