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
Would throw an error as the fmt is empty string instead of JSON:
Traceback (most recent call last):
File "/Users/yang/developer/pymatgen/debug/test_structure_to.py", line 10, in <module>
structure.to()
~~~~~~~~~~~~^^
File "/Users/yang/developer/pymatgen/src/pymatgen/core/structure.py", line 3028, in to
raise ValueError(f"Format not specified and could not infer from {filename=}")
ValueError: Format not specified and could not infer from filename=''
raiseValueError(f"Format not specified and could not infer from {filename=}")
raiseValueError(f"Invalid {fmt=}, valid options are {get_args(FileFormats)}")
The text was updated successfully, but these errors were encountered:
DanielYang59
changed the title
Default format of IStructure.to doesn't agree with docstring
Default fmt of IStructure.to doesn't agree with docstring
Feb 27, 2025
As per the
IStructure.to
docstring:pymatgen/src/pymatgen/core/structure.py
Lines 2920 to 2932 in b5d03d7
The default
fmt
should bejson
whenfilename
is not provided.However:
Would throw an error as the
fmt
is empty string instead of JSON:pymatgen/src/pymatgen/core/structure.py
Lines 3026 to 3029 in b5d03d7
The text was updated successfully, but these errors were encountered: