You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Delay the printing of warnings as late as possible in io.cif.
Currently, just importing the module io.cif will print the warning if pybtex is not installed:
try:
from pybtex.database import BibliographyData, Entry
except ImportError:
warnings.warn("Please install optional dependency pybtex if you"
"want to extract references from CIF files.")
BibliographyData, Entry = None, None
However, the only function requiring it is get_bibtex_string.
Describe the solution you'd like
Since these warnings are not easy to suppress and show up even when not applicable it would be better to just move this warning to within the get_bibtex_string itself. One can simply extend the message of the requires decorator
The text was updated successfully, but these errors were encountered:
Thanks. I fixed this. But instead of a warning, I simply make it throw an exception. The idea is that if someone is calling get_bibtex_string, they must actually be interested in a result and a runtime error should ensue if pybtex is not installed.
Is your feature request related to a problem? Please describe.
Delay the printing of warnings as late as possible in
io.cif
.Currently, just importing the module
io.cif
will print the warning ifpybtex
is not installed:However, the only function requiring it is
get_bibtex_string
.Describe the solution you'd like
Since these warnings are not easy to suppress and show up even when not applicable it would be better to just move this warning to within the
get_bibtex_string
itself. One can simply extend the message of therequires
decoratorThe text was updated successfully, but these errors were encountered: