Closed HarmonicReflux closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 71.39%. Comparing base (
2e8e1b5
) to head (297e8db
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Well, for "Results/MCACapacity.csv" to be visible, one has to create it first, and the most simple way of creating it is by running a model, say the default model via muse --model default
. Hence, I included invocation of this command in the documentation. If users then run the test suite, the failure will not occur.
As @dalonsoa pointed out: If my suggestion is not the one to go for, I can think of either:
i) Include the file into the codebase (still feels a bit hacky to me)
ii) Defining to tun the default model in the setup file such that it is created while running python -m pip install -e .[dev,doc]
iii) Any other suggestions?
I think the main issue here is:
What makes no sense is to have a notebook in the docs requiring data in the root directory.
There's a discussion going on on how to avoid committing data to the repository, but that's a longer term discussion and we do not have an answer for it, yet.
And remember to update the branch and, ideally, add a PR description - not essential, but serve as reference for the future.
Did you want me to review this @HarmonicReflux?
Did you want me to review this @HarmonicReflux?
Yes, please take a look, so we are all on the same page. Thks.
Appreciated comments of the reviewers.
@alexdewar please take a look at this reworked pull request.
I'm still a bit unsure about this, because we specifically need a results folder in the docs
folder, so running muse --model default
in the root folder won't be enough. The link that Alex created in the docs workflow will only exist if the user runs the documentation build locally (right?) which we're not asking people to do before running the tests, so I'm not sure how this fixes the problem. Am I missing something?
Running a model will create a "Results" folder in the directory MUSE is installed. The results folder itself then contains subfolder that of which one contains the file the one testing the notebooks needs to have access in order to run successfully. To my knowledge, building the documentation is a separate process unrelated to the tests themselves.
I get that, but the notebook in question (running-muse-example.ipynb
) points to a Results folder contained in the docs
folder, not the root folder
@dalonsoa and @tsmbland, please review this pull-request.
@alexdewar is out of office until later this week.
Description
This pull request refactors the way
muse --model -default
is executed to ensure that all tests pass.Specifically, the Results/MCACapacity.csv file is now placed within the docs folder, which is where the test expects to find MCACapacity.csv. The necessary file is created during the test run by the notebook itself and subsequently picked up by it. This change resolves the error that causes pytest to fail, and as a result, all tests now pass by default.
Fixes #261
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s.
Key checklist
$ python -m pytest
$ python -m sphinx -b html docs docs/build
Further checks