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

Various deprecation warnings #3672

Closed
sphuber opened this issue Dec 15, 2019 · 6 comments
Closed

Various deprecation warnings #3672

sphuber opened this issue Dec 15, 2019 · 6 comments
Labels
good first issue Issues that should be relatively easy to fix also for beginning contributors priority/nice-to-have topic/data-types topic/rest-api type/bug

Comments

@sphuber
Copy link
Contributor

sphuber commented Dec 15, 2019

  • aiida.restapi.translator.nodes.node.NodeTranslator._get_subclasses uses the deprecated imp module.
  • aiida.orm.nodes.data.structure.ase_refine_cell passes ASE object to spglib.refine_cell which is deprecated.
  • aiida/backends/tests/test_dataclasses.py::TestKpointsData::test_path_wrapper_legacy gets warning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
@ltalirz ltalirz added the good first issue Issues that should be relatively easy to fix also for beginning contributors label Feb 3, 2020
@ltalirz
Copy link
Member

ltalirz commented Apr 13, 2020

As for the warning

 /opt/hostedtoolcache/Python/3.8.2/x64/lib/python3.8/site-packages/spglib/spglib.py:895: DeprecationWarning: ASE Atoms-like input is deprecated.
    warnings.warn("ASE Atoms-like input is deprecated.",

See here for the fix
https://atztogo.github.io/spglib/python-spglib.html#ase-atoms-like-input-is-deprecated

@CasperWA
Copy link
Contributor

There was another deprecation warning in the REST API module aiida.restapi.common.identifiers:

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working

This will be fixed in #3974.

@DirectriX01
Copy link
Contributor

DirectriX01 commented Apr 6, 2021

I've created a pull request for aiida.restapi.translator.nodes.node.NodeTranslator._get_subclasses I'm not sure on how to work on the aiida.orm.nodes.data.structure.ase_refine_cell warning, the ASE structure is used by various functions, such as

def cif_from_ase(ase, full_occupancies=False, add_fake_biso=False):

@ltalirz
Copy link
Member

ltalirz commented Apr 6, 2021

thanks @DirectriX01

I'm not sure on how to work on the aiida.orm.nodes.data.structure.ase_refine_cell warning

Haven't looked into it in detail, but I guess you'll need to extract the "tuple input data"
described in https://atztogo.github.io/spglib/python-spglib.html#ase-atoms-like-input-is-deprecated

here

cell, positions, numbers = refine_cell(aseatoms, **kwargs)

@unkcpz
Copy link
Member

unkcpz commented Nov 11, 2021

To show the deprecated message, just run the correspondence test cases. After having aiida environment set, run:

$ pytest -v tests/test_dataclasses.py::TestCifData::test_get_structure
$ pytest -v tests/test_dataclasses.py::TestKpointsData::test_path_wrapper_legacy
$ pytest -v pytest tests/restapi/test_translator.py

There are more deprecated message outputs than you can find as described in this issue.
Better to fix them all.

@sphuber
Copy link
Contributor Author

sphuber commented Nov 9, 2022

This is very outdated. Some reported have since been addressed, many others have been added. No point in keeping this around

@sphuber sphuber closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that should be relatively easy to fix also for beginning contributors priority/nice-to-have topic/data-types topic/rest-api type/bug
Projects
None yet
Development

No branches or pull requests

5 participants