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

DeprecationWarning raised in CI #372

Open
ElliottKasoar opened this issue Jan 2, 2025 · 0 comments · May be fixed by #376
Open

DeprecationWarning raised in CI #372

ElliottKasoar opened this issue Jan 2, 2025 · 0 comments · May be fixed by #376
Assignees
Labels
bug Something isn't working priority Urgent attention required testing Unit testing or CI

Comments

@ElliottKasoar
Copy link
Member

ElliottKasoar commented Jan 2, 2025

Currently (re-)running the CI throws an error, due to a deprecation warning when loading CHGNet (see also: materialsproject/pymatgen#4243):

==================================== ERRORS ====================================
_______________ ERROR collecting tests/test_mlip_calculators.py ________________
tests/test_mlip_calculators.py:8: in <module>
    from chgnet.model.model import CHGNet
.venv/lib/python3.10/site-packages/chgnet/model/__init__.py:3: in <module>
    from chgnet.model.dynamics import CHGNetCalculator, MolecularDynamics, StructOptimizer
.venv/lib/python3.10/site-packages/chgnet/model/dynamics.py:24: in <module>
    from pymatgen.analysis.eos import BirchMurnaghan
.venv/lib/python3.10/site-packages/pymatgen/analysis/eos.py:23: in <module>
    from pymatgen.core.units import FloatWithUnit
.venv/lib/python3.10/site-packages/pymatgen/core/__init__.py:12: in <module>
    from pymatgen.core.composition import Composition
.venv/lib/python3.10/site-packages/pymatgen/core/composition.py:22: in <module>
    from pymatgen.core.periodic_table import DummySpecies, Element, ElementType, Species, get_el_sp
.venv/lib/python3.10/site-packages/pymatgen/core/periodic_table.py:63: in <module>
    class ElementBase(Enum):
.venv/lib/python3.10/site-packages/pymatgen/core/periodic_table.py:755: in ElementBase
    @deprecated(is_rare_earth, message="is_rare_earth is corrected to include Y and Sc.", deadline=(2025, 1, 1))
.venv/lib/python3.10/site-packages/monty/dev.py:157: in deprecated
    raise_deadline_warning()
.venv/lib/python3.10/site-packages/monty/dev.py:86: in raise_deadline_warning
    raise DeprecationWarning(
E   DeprecationWarning: This function should have been removed on 2025-01-01.

---------- coverage: platform linux, python 3.10.16-final-0 ----------
Coverage XML written to file coverage.xml

=========================== short test summary info ============================
ERROR tests/test_mlip_calculators.py - DeprecationWarning: This function should have been removed on 2025-01-01.
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 4.56s ===============================

Since the warning is generated by raise, it seems that --disable-warnings and other pytest filters don't suppress this, so I'm not sure if there's a simple workaround?

One option could be to alter he environment variables that are checked before the warning is raised e.g. GITHUB_REPOSITORY/CI - see CI/repository checks, but that may have unexpected side effects, so I don't think it's a good solution.

Hopefully this can be removed from pymatgen relatively quickly, but unfortunately they only support Python 3.10+, so we may need to reconsider 3.9 support to make use of any fixes.

@ElliottKasoar ElliottKasoar added bug Something isn't working testing Unit testing or CI priority Urgent attention required labels Jan 2, 2025
@ElliottKasoar ElliottKasoar self-assigned this Jan 2, 2025
@ElliottKasoar ElliottKasoar changed the title DeprecationWwarning raised in CI DeprecationWarning raised in CI Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority Urgent attention required testing Unit testing or CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant