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

[patch] replace logger with snippets version #1073

Merged
merged 7 commits into from
Jun 4, 2024
Merged

Conversation

liamhuber
Copy link
Member

i.e. pyiron_base.state.logger.logger with pyiron_snippets.logger.logger. The original location leaves a re-direct for backwards compatibility.

Copy link
Contributor

github-actions bot commented Jun 3, 2024

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_contrib/snippets_logger

@liamhuber
Copy link
Member Author

Notebook failure:

 Input Notebook:  notebooks/tinybase/Lammps.ipynb
Output Notebook: notebooks/tinybase/Lammps-out.ipynb

Executing:   0%|          | 0/29 [00:00<?, ?cell/s]Executing notebook with kernel: python3

Executing:   3%|▎         | 1/29 [00:02<00:58,  2.10s/cell]
Executing:   3%|▎         | 1/29 [00:02<01:07,  2.41s/cell]
Traceback (most recent call last):
  File "/usr/share/miniconda3/envs/my-env/bin/papermill", line 10, in <module>
    sys.exit(papermill())
             ^^^^^^^^^^^
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/papermill/cli.py", line 235, in papermill
    execute_notebook(
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/papermill/execute.py", line 131, in execute_notebook
    raise_for_execution_errors(nb, output_path)
  File "/usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/papermill/execute.py", line 251, in raise_for_execution_errors
    raise error
papermill.exceptions.PapermillExecutionError: 
---------------------------------------------------------------------------
Exception encountered at "In [1]":
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 from pyiron_contrib.tinybase.lammps import LammpsStaticTask

File ~/work/pyiron_contrib/pyiron_contrib/pyiron_contrib/tinybase/lammps.py:3
      1 import os
----> 3 from pymatgen.io.lammps.outputs import (
      4     parse_lammps_dumps,
      5     parse_lammps_log,
      6 )
      8 from pyiron_atomistics.lammps.potential import (
      9     LammpsPotential,
     10     LammpsPotentialFile,
     11     list_potentials,
     12 )
     13 from pyiron_atomistics.lammps.control import LammpsControl

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pymatgen/io/lammps/outputs.py:18
     15 from monty.io import zopen
     16 from monty.json import MSONable
---> 18 from pymatgen.io.lammps.data import LammpsBox
     20 if TYPE_CHECKING:
     21     from typing import Any

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pymatgen/io/lammps/data.py:32
     29 from monty.serialization import loadfn
     30 from ruamel.yaml import YAML
---> 32 from pymatgen.core import Element, Lattice, Molecule, Structure
     33 from pymatgen.core.operations import SymmOp
     34 from pymatgen.util.io_utils import clean_lines

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pymatgen/core/__init__.py:12
      8 from typing import Any
     10 from ruamel.yaml import YAML
---> 12 from pymatgen.core.composition import Composition
     13 from pymatgen.core.lattice import Lattice
     14 from pymatgen.core.operations import SymmOp

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pymatgen/core/composition.py:22
     19 from monty.json import MSONable
     20 from monty.serialization import loadfn
---> 22 from pymatgen.core.periodic_table import DummySpecies, Element, ElementType, Species, get_el_sp
     23 from pymatgen.core.units import Mass
     24 from pymatgen.util.string import Stringify, formula_double_format

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pymatgen/core/periodic_table.py:39
     32     _pt_data = json.load(ptable_json)
     34 _pt_row_sizes = (2, 8, 8, 18, 18, 32, 32)
     37 @functools.total_ordering
     38 @unique
---> 39 class ElementBase(Enum):
     40     """Element class defined without any enum values so it can be subclassed.
     41 
     42     This class is needed to get nested (as|from)_dict to work properly. All emmet classes that had
   (...)
     45     only when they were top level. See https://github.com/materialsproject/pymatgen/issues/2999.
     46     """
     48     def __init__(self, symbol: SpeciesLike) -> None:

File /usr/share/miniconda3/envs/my-env/lib/python3.12/site-packages/pymatgen/core/periodic_table.py:700, in ElementBase()
    696     """True if element is a post-transition or poor metal."""
    697     return self.symbol in ("Al", "Ga", "In", "Tl", "Sn", "Pb", "Bi")
    699 @property
--> 700 @deprecated(
    701     message="Please use is_rare_earth instead, which is corrected to include Y and Sc.", deadline=(2025, 1, 1)
    702 )
    703 def is_rare_earth_metal(self) -> bool:
    704     """True if element is a rare earth metal, Lanthanides (La) series and Actinides (Ac) series.
    705 
    706     This property is Deprecated, and scheduled for removal after 2025-01-01.
    707     """
    708     return self.is_lanthanoid or self.is_actinoid

TypeError: deprecated() got an unexpected keyword argument 'deadline'

This is completely unrelated, it's not even our deprecator that's failing, nor even our call. At first glance it looks like pymatgen has an internal inconsistency.

Base automatically changed from snippets_deprecate to main June 3, 2024 17:48
@coveralls
Copy link

coveralls commented Jun 3, 2024

Pull Request Test Coverage Report for Build 9371084055

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 12.826%

Totals Coverage Status
Change from base Build 9366443243: 0.0%
Covered Lines: 1280
Relevant Lines: 9980

💛 - Coveralls

@liamhuber
Copy link
Member Author

Ok, pinning pymatgen to the penultimate release does the trick, but as discussed in #1074 this is not my favourite solution

@liamhuber
Copy link
Member Author

ModuleNotFoundError: No module named 'pyiron_atomistics.atomistics.master.elastic'

Ugh. I guess pinning pymatgen got us a different version of pyiron_atomistics than we wanted. I am not able to dig into this immediately.

@pmrv
Copy link
Contributor

pmrv commented Jun 4, 2024

ModuleNotFoundError: No module named 'pyiron_atomistics.atomistics.master.elastic'

Ugh. I guess pinning pymatgen got us a different version of pyiron_atomistics than we wanted. I am not able to dig into this immediately.

I think it got us the correct version, but the import error there originates from #1040 where @jan-janssen forgot to update the import paths in the tests. I'll fix it in a separate PR, but it made me realize that we don't actually specify the version of pyiron_atomistics in the conda env, as it is only a optional dependency in the setup.py

@liamhuber liamhuber merged commit ec2e7f6 into main Jun 4, 2024
16 checks passed
@liamhuber liamhuber deleted the snippets_logger branch June 4, 2024 18:09
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