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

CodDbImporter throws warning about pybtex when importing CIF file #2903

Closed
borellim opened this issue May 22, 2019 · 6 comments · Fixed by #3597
Closed

CodDbImporter throws warning about pybtex when importing CIF file #2903

borellim opened this issue May 22, 2019 · 6 comments · Fixed by #3597

Comments

@borellim
Copy link
Member

Example:

from aiida.tools.dbimporters.plugins.cod import CodDbImporter
importer = CodDbImporter()
structure_Al = importer.query(id='9008460')[0].get_aiida_structure()

Outputs:

/home/aiidatests/venvs/aiida_py3.6/lib/python3.6/site-packages/pymatgen/io/cif.py:44: UserWarning: Please install optional dependency pybtex if youwant to extract references from CIF files.
  warnings.warn("Please install optional dependency pybtex if you"
@ltalirz
Copy link
Member

ltalirz commented Jun 1, 2019

@giovannipizzi @CasperWA
Are we going to "fix" this?
Should we simply fix this by installing pybtex as a dependency for the tutorial?

@ltalirz
Copy link
Member

ltalirz commented Jun 1, 2019

Perhaps this warning could be moved to a place that is only is called when someone explicitly requests extraction of references?

@giovannipizzi
Copy link
Member

Perhaps this warning could be moved to a place that is only is called when someone explicitly requests extraction of references?

I think so, but we should write to the pymatgen people for this.
For the tutorial/quantum mobile indeed we can add the dependency (even if we should check if this requires also to install LaTeX, and then I would say no if we don't have LaTeX already, since the dependency can be quite heavy). But I would say not for AiiDA in general - and yes, the best strategy is to avoid that this is printed by pymatgen if not needed.

@sphuber
Copy link
Contributor

sphuber commented Jun 23, 2019

I have opened an issue on pymatgen to ask them to move the warning to a place where it is only emitted if the required functionality is requested, which we don't. There is not much we can or should do here

@ltalirz
Copy link
Member

ltalirz commented Jun 23, 2019

Well, for the time being we could simply filter this warning in AiiDA.
I suggest we do this.

@sphuber
Copy link
Contributor

sphuber commented Jun 23, 2019

They just addressed the issue. If we do add the filter, we should make sure to remove that code once we can depend on the newer version that fixes this (I don't think they do releases for py2 anymore, so that will be after we drop py2 as well). These kinds of "fixes" tend to stick around way past to where they are needed and clutter the source a lot

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 a pull request may close this issue.

4 participants