Fix Incar check_params for Union type #3958
Conversation
|
This might be a silly question, but is changing the "type" parameter in the json file possible? The following evaluates to typing.Union type(eval('bool | str'))Example: |
|
That's actually an ingenious solution IMO, now that using of However the only pitfall being that the alias of |
check_params for composite types check_params for Union type
03b546e to
93f18d6
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
@janosh Can you please review this? Thanks. I believe the CI failing is unrelated to this PR. |
i think the issue is due to installing the latest pymatgen/.github/workflows/test.yml Line 80 in 633e7bd can you try pinning to torch |
|
Yes sure. Let me have a try. |
|
Looks like |
|
afaik |
|
Sure! Thanks for the input, and I know nothing about |
This reverts commit 215c888.
Signed-off-by: Janosh Riebesell <janosh.riebesell@gmail.com>
|
Thanks for reviewing! |
check_params for Union type Incar check_params for Union type
* drop python 3.9 and add python 3.13 * remove yanked matplotlib pin * remove clarified TODO tag * bump python version in CI * try to explicitly declare python 313 in mamba * use 3.13 pre-release rc1 * remove Python 3.13 * remove TODO for Python 2 * remove docstring TODO for unit test * enable this seemingly passing test * tweak and fix typo in get_dos_fp_similarity ValueError msg * ruff auto-fixes * manual fix: type unions use pipe op * replace union with | operator * add TypeAlias to honor type-alias-without-annotation (PYI026) * replace pariwise iteration using zip with itertools * fix error message * not sure why it failed, try to separate available index * sure I forgot about double quote and single quote * use | in INCAR tag check from #3958 * fix RUF017 * Revert "fix RUF017" as I haven't got time to verify This reverts commit b6dbf20. * fix DeprecationWarning: dict interface (SpglibDataset['international']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead --------- Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>
Summary
Fix Incar
check_paramsforUniontype, to fix Vasp Incar check_params() can't handle Union types #3957, changedincar_parameters.jsonof Union type to useisinstancesyntax directly. Otherwise Python 3.9 Windows don't support type checking withisinstance(data, Union[str, float]).Would appreciate it if anyone has smarted way to resolve this!
Bump
palettableversion to remove dependency ofsetuptoolsWrite colorbrewer palettes to .py file and remove setuptools dependency jiffyclub/palettable#46