materialsproject / jobflow

jobflow is a library for writing computational workflows.
https://materialsproject.github.io/jobflow
Other
90 stars 25 forks source link

Fix jsanitize in `contains_flow_or_job` #559

Open gpetretto opened 4 months ago

gpetretto commented 4 months ago

This change in emmet https://github.com/materialsproject/emmet/commit/7735bb1a51cd9b339789bbdca0df92fbe366ddb8 leads to an error in contains_flow_or_job, due to the impossibility to call as_dict on some Enums. This PR adds the enum_values=True to handle those cases.

In general, I am wondering if it is worth making this check every time a Flow is instantiated.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.42%. Comparing base (eda2a65) to head (f0aa70d). Report is 10 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #559 +/- ## ======================================= Coverage 99.42% 99.42% ======================================= Files 21 21 Lines 1564 1564 Branches 425 425 ======================================= Hits 1555 1555 Misses 9 9 ``` | [Files](https://app.codecov.io/gh/materialsproject/jobflow/pull/559?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject) | Coverage Δ | | |---|---|---| | [src/jobflow/utils/find.py](https://app.codecov.io/gh/materialsproject/jobflow/pull/559?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-c3JjL2pvYmZsb3cvdXRpbHMvZmluZC5weQ==) | `100.00% <100.00%> (ø)` | |
FabiPi3 commented 3 months ago

@gpetretto Fyi, I am trying to store the whole enum information in the output. I think this should fix this as well. Here are my pull requests: https://github.com/materialsvirtuallab/monty/pull/640 and https://github.com/materialsproject/jobflow/pull/565

What are your thoughts about this?