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

Removed Google colab error warning. #3886

Merged
merged 10 commits into from
Mar 18, 2024

Conversation

prady0t
Copy link
Contributor

@prady0t prady0t commented Mar 11, 2024

Description

Follow-up of #3740

Fixes # (issue)

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.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ 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)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ 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:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
@agriyakhetarpal
Copy link
Member

Thanks @prady0t, could you remove these lines:

# Temporary fix for Python 3.12 CI. TODO: remove after
# https://bitbucket.org/pybtex-devs/pybtex/issues/169/replace-pkg_resources-with
# is fixed
session.install("setuptools", silent=False)

wherever they exist in noxfile.py?

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
@prady0t
Copy link
Contributor Author

prady0t commented Mar 11, 2024

Sorry for making changes lazily. 🙂 I've updated the PR.

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (8056d22) to head (abc7cc6).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3886      +/-   ##
===========================================
- Coverage    99.60%   99.60%   -0.01%     
===========================================
  Files          259      259              
  Lines        21273    21268       -5     
===========================================
- Hits         21189    21184       -5     
  Misses          84       84              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Thanks, @prady0t! This looks nice! See my comment below -

pybamm/citations.py Outdated Show resolved Hide resolved
@agriyakhetarpal
Copy link
Member

Also, it looks like the doctests on Python 3.12 are failing (strange) but all other jobs on Python 3.12 pass. Could we re-add the setuptools installation to the doctests session for now?

@kratman
Copy link
Contributor

kratman commented Mar 12, 2024

Also, it looks like the doctests on Python 3.12 are failing (strange) but all other jobs on Python 3.12 pass. Could we re-add the setuptools installation to the doctests session for now?

It could be a latex parsing issue: SyntaxWarning: invalid escape sequence '\m' is caused by self.spatial_unit = "$\mu$m" Maybe we need to make them raw strings or something:

self.spatial_unit = r"$\mu$m"

@agriyakhetarpal
Copy link
Member

Yes, that warning would be good to fix too. But the failure seems to be coming from a Sphinx-related warning: sphinxcontrib_bibtex can't find pkg_resources – even though it is enabled with setuptools as a seed package in other sessions 😕

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
@prady0t
Copy link
Contributor Author

prady0t commented Mar 13, 2024

I've re added setuptools installation to the doctests session and removed checks for error messages.

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Thanks, @prady0t! This looks good to me from the pybtex point of view. I'll leave the setuptools bit for @agriyakhetarpal to review.

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

The doctests and example scripts are still failing on Python 3.12, and I'm not sure why. We have two options:

  1. Add the session.install("setuptools") hack back again for the time being
  2. Modify these sessions in the workflows to run on Python 3.11 instead.

I would go forward with the first option at this time, because using the latest available Python version will help us catch any related (or unrelated) issues early.

@kratman
Copy link
Contributor

kratman commented Mar 13, 2024

The doctests and example scripts are still failing on Python 3.12, and I'm not sure why. We have two options:

  1. Add the session.install("setuptools") hack back again for the time being
  2. Modify these sessions in the workflows to run on Python 3.11 instead.

I would go forward with the first option at this time, because using the latest available Python version will help us catch any related (or unrelated) issues early.

Not all of our functionality works on 3.12, so 3.11 is probably better

@agriyakhetarpal
Copy link
Member

Not all of our functionality works on 3.12, so 3.11 is probably better

Yes, I had considered that when posting my comment – I had checked the example scripts and none of them are currently using unsupported functionality (which is scikits.odes for Python 3.12). So Python 3.12 would be fine (for the docs-related tests, it also helps catch warnings/errors early because most documentation dependencies are pure-Python and do not have an upper bound on their Python version requirement). So we can go ahead with either of those, but I tend to lean slightly on 3.12. Both Python versions have a long time till their EOL.

@kratman
Copy link
Contributor

kratman commented Mar 13, 2024

I tend to lean slightly on 3.12. Both Python versions have a long time till their EOL.

I would say that it is better to go with a version where everything runs, we can always upgrade the version later. It is for the documentation generation, not something that must be the newest python

@agriyakhetarpal
Copy link
Member

I would say that it is better to go with a version where everything runs, we can always upgrade the version later. It is for the documentation generation, not something that must be the newest python

Sure, let's do it for just the doctests, but keep Python 3.12 for the example scripts (because it matches with the example notebooks tests).

@prady0t
Copy link
Contributor Author

prady0t commented Mar 17, 2024

would doing

@nox.session(name="doctests", python="3.11")

work?

@agriyakhetarpal
Copy link
Member

would doing

@nox.session(name="doctests", python="3.11")

work?

You don't need to change the nox configuration for the doctests. We just need to fix the CI and we should be good to go – just alter test_on_push.yml to use Python 3.11 in the doctests job instead of Python 3.12. The only change required in noxfile.py is to bring back the session.install("setuptools") line that you had removed from the example scripts session.

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Thanks, @prady0t! All good now. As discussed, let's revisit python-bibtexparser at some other time.

@agriyakhetarpal agriyakhetarpal merged commit 39cff38 into pybamm-team:develop Mar 18, 2024
45 of 46 checks passed
@prady0t
Copy link
Contributor Author

prady0t commented Mar 18, 2024

Yess. I'll be more than happy to rework here.

@prady0t prady0t deleted the using-pybtex-again branch March 18, 2024 12:49
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this pull request Aug 12, 2024
* Removed Google colab error warning

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

* removed temp fixes

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

* removed redundant code

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

* run CI om python 3.11

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>

---------

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Co-authored-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Eric G. Kratz <kratman@users.noreply.github.com>
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.

4 participants