-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
Added pooch registries for data files #4098
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Additionally, could you use the function you added in the failing tests as well? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4098 +/- ##
===========================================
- Coverage 99.55% 99.54% -0.02%
===========================================
Files 287 288 +1
Lines 21753 21767 +14
===========================================
+ Hits 21657 21668 +11
- Misses 96 99 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, @santacodes! Could you fix the coverage by adding additional tests for the get_data
method (to check the NameError
that you raised), and for the checksum
option in the show_registry
method? @valentinsulzer, could you review this as well?
Besides this, I will recommend building the source distribution and the wheels on your fork by triggering the manual job we have available, and locally using python -m build
to ensure that we aren't missing out on any files and that the sizes of the distributions are alright.
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now, thanks, @santacodes! I'll wait for some additional thoughts on this before we merge.
cc @cringeyburger @prady0t – this PR has removed (most of) the PyBaMM data files from the PyBaMM source code. Testing the built wheels using CIBW_TEST_COMMAND
should now be a bit easier. I feel that the pytest --pyargs pybamm
invocation would be better than a pybamm.test()
one – that way we would not need to move the tests/
directory inside pybamm/
docs/source/examples/notebooks/models/Validating_mechanical_models_Enertech_DFN.ipynb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've no further concerns with this one, good work @santacodes.
@agriyakhetarpal are we good to merge this or we still seek +1 review?
I think this is good to go on my end, but I just had a question about skipping tests without networks – @santacodes, the |
For notebooks and scripts, I am thinking we could add an error-handling method to raise an Error, pooch raises |
I thought of that but both of these options should ideally stay outside and abstracted away from the content inside the notebooks and scripts, which isn't quite viable and seems over-engineered... I opine that we should skip them for now. We can help out on a per-user basis if someone tries to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes to the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For any other reviewers: I checked the link failure. It should start passing once this PR is merged. The link checker goes with the stable documentation, so it cannot see the new page
Co-authored-by: Eric G. Kratz <kratman@users.noreply.github.com>
Maybe we should refer to the reST-based heading for PyBaMM Data instead of adding an HTTP(S) link to our documentation? Otherwise, this failing link will keep failing for all the release candidates until we have the v24.5 release out – the link is pointing to |
Changing to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking @agriyakhetarpal's last comment as a change request to keep this from being merged until it is fixed:
Changing to
../api/pybamm_data.rst
won't help – could you add a heading under the PyBaMM Data page and use reST syntax to link to it? Something under this SO post should help
I tried referencing headers, but sphinx doesn't seem to render it as a link no matter what, even when I reference the |
I think this should be okay, then, thanks for the explanation. Not sure if there is a better way to link them unless we switch to MyST completely for the codebase, which is something for a later time |
Based on the reasoning provided we can go forward with this. The documentation is able to link to the requested page without issues
* added pooch * removed getpath() * added data_loader to notebooks and scripts * removed data files in the registry * added docs and implemented code review suggestions * added example notebook, unit tests and edited changelog * fixed pouch cell notebook * Apply suggestions from code review Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * style: pre-commit fixes * added more test coverage, fixed notebook and code review suggestions * added bib references * fixed doctest and script test errors * fixed codacy warnings * using sockets for checking network * code review suggestions along with notebook update * Apply suggestions from code review Co-authored-by: Eric G. Kratz <kratman@users.noreply.github.com> * fixed RUF015 * changed link referenced and fixed lychee warning * changed the data files link under input/ to pybamm-data repo --------- Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ferran Brosa Planella <Ferran.Brosa-Planella@warwick.ac.uk> Co-authored-by: Arjun Verma <arjunverma.oc@gmail.com> Co-authored-by: Eric G. Kratz <kratman@users.noreply.github.com>
Description
pybamm/input
pybamm/input/parameters
have not been removed or included in the pooch registries.pybamm.DataLoader
class.Fixes #4026
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. If necessary, also add to the list of breaking changes.
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
(or$ nox -s tests
)$ python run-tests.py --doctest
(or$ nox -s doctests
)You can run integration tests, unit tests, and doctests together at once, using
$ python run-tests.py --quick
(or$ nox -s quick
).Further checks: