-
Notifications
You must be signed in to change notification settings - Fork 871
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
Fix Incar
check_params
for Union
type
#3958
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot @DanielYang59! 👍
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 <[email protected]>
Summary
Fix Incar
check_params
forUnion
type, to fix Vasp Incar check_params() can't handle Union types #3957, changedincar_parameters.json
of Union type to useisinstance
syntax 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
palettable
version to remove dependency ofsetuptools
Write colorbrewer palettes to .py file and remove setuptools dependency jiffyclub/palettable#46