-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
Fix optional dependencies error detection and remove pybtex
hidden dependency
#3968
Fix optional dependencies error detection and remove pybtex
hidden dependency
#3968
Conversation
Thanks, @lorenzofavaro – with the failing tests we can confirm that we are now testing the PyBaMM import correctly and properly :) I guess the next step is the one you highlighted about |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Thanks @agriyakhetarpal, I tried this way but the problem was being able to handle a single instance of the object, and unit tests were failing. It seems like it is not the intended use of it, so either we change the way we use I followed the second way and the solution I found was using the singleton pattern. Let me know if this solution is fine for you. I'm open to implement any other better ways. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3968 +/- ##
========================================
Coverage 99.58% 99.58%
========================================
Files 257 257
Lines 21245 21249 +4
========================================
+ Hits 21157 21161 +4
Misses 88 88 ☔ 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, @lorenzofavaro, this is great – just a single comment about the new API for registering citations which probably needs a revisit :)
Also, could we update the documentation for the optional dependencies section in the Contributing guide in this PR as necessary, as we had discussed? |
37e2024
to
e02662f
Compare
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
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 all great to me now, thanks for the fixes, @lorenzofavaro! Let's hope CI passes on this one, I have no other comments.
@all-contributors please add @lorenzofavaro for docs |
I've put up a pull request to add @lorenzofavaro! 🎉 |
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 @lorenzofavaro, This looks good to me and I'd be happy to merge this seeing the priority. but -
Resolving previous conversations for now and all tests are passing – let's merge |
…dependency (pybamm-team#3968) * Edit pybamm import test * Guard pybtex imports * Update pybamm/citations.py Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * Update pybamm/citations.py (1) Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * Update pybamm/citations.py (2) Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * Update pybamm/citations.py (3) Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * Update contributing guidelines * Exclude excepts from test coverage * style: pre-commit fixes --------- Co-authored-by: Lorenzo Favaro <lorenzofavaro@users.noreply.github.com> 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: Eric G. Kratz <kratman@users.noreply.github.com> Co-authored-by: Arjun Verma <arjunverma.oc@gmail.com>
Description
The goal of this PR is to solve two problems.
pybamm
can be imported without optional dependencies installedFixes #3940
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
)$ python run-tests.py --all
(or$ nox -s tests
)$ python run-tests.py --doctest
(or$ nox -s doctests
)