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

Recursive up-to-date checks (ref #614). #627

Merged
merged 3 commits into from
Oct 20, 2022

Conversation

tillahoffmann
Copy link
Contributor

Submission Checklist

  • Run unit tests
  • Declare copyright holder and open-source license: see below

Summary

This PR addresses #614 by running up-to-date checks recursively on included files.

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): Harvard University

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

@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2022

Codecov Report

Merging #627 (cb356a6) into develop (fb3dfe2) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop     #627      +/-   ##
===========================================
- Coverage    80.20%   80.19%   -0.01%     
===========================================
  Files           69       69              
  Lines        10326    10332       +6     
===========================================
+ Hits          8282     8286       +4     
- Misses        2044     2046       +2     
Impacted Files Coverage Δ
a/cmdstanpy/cmdstanpy/cmdstanpy/model.py 89.50% <0.00%> (-0.36%) ⬇️
cmdstanpy/cmdstanpy/model.py 88.71% <0.00%> (+0.04%) ⬆️
...runner/work/cmdstanpy/cmdstanpy/cmdstanpy/model.py 88.71% <0.00%> (+0.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

cmdstanpy/model.py Outdated Show resolved Hide resolved
@tillahoffmann tillahoffmann marked this pull request as ready for review October 19, 2022 18:53
Copy link
Member

@WardBrian WardBrian left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together!

A couple comments and a request for an extra test, but otherwise this looks great!

Comment on lines +481 to +482
os.path.getmtime(included_file) > exe_time
for included_file in included_files
Copy link
Member

Choose a reason for hiding this comment

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

Even after using src_info, this still needs to take include_paths into account, no?

Oh, actually, I just checked and src_info returns the actual included file paths, not just the relative paths. That's much better.

Regardless, I think it is still worth adding a test for an include which uses include_paths set to something non-default.

cmdstanpy/model.py Show resolved Hide resolved
Copy link
Member

@WardBrian WardBrian left a comment

Choose a reason for hiding this comment

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

This looks great to me!

Two comments in the test, but otherwise I think this is ready to merge. Thanks again!

test/test_model.py Show resolved Hide resolved
test/test_model.py Show resolved Hide resolved
@WardBrian WardBrian merged commit 4d99ecc into stan-dev:develop Oct 20, 2022
@WardBrian WardBrian mentioned this pull request Oct 20, 2022
@tillahoffmann
Copy link
Contributor Author

As an afterthought, it turns out that src_info fails relatively silently if an included file is missing (it only logs a debug message). Consequently, included_files is not available if an included file is missing. This leads to the following bug:

  1. create CmdstanpyModel (compiles the model)
  2. delete the included file
  3. create CmdstanpyModel (will not compile the model or raise an error)

@WardBrian
Copy link
Member

That’s no worse that the behavior before this PR, right?

tillahoffmann added a commit to tillahoffmann/gptools that referenced this pull request Oct 20, 2022
tillahoffmann added a commit to tillahoffmann/gptools that referenced this pull request Oct 20, 2022
@tillahoffmann
Copy link
Contributor Author

True, maybe something to fix another time.

tillahoffmann added a commit to tillahoffmann/gptools that referenced this pull request Dec 29, 2022
tillahoffmann added a commit to tillahoffmann/gptools that referenced this pull request Dec 29, 2022
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