-
Notifications
You must be signed in to change notification settings - Fork 69
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
TaskDoc refactor #971
TaskDoc refactor #971
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #971 +/- ##
==========================================
- Coverage 77.24% 77.11% -0.14%
==========================================
Files 75 75
Lines 4329 4339 +10
==========================================
+ Hits 3344 3346 +2
- Misses 985 993 +8 ☔ View full report in Codecov by Sentry. |
If there are breaking changes to |
Hi @mkhorton, there shouldn't be breaking changes to A good example is the For compatibility with atomate2, I presume that the Apologies in advance for the long-winded answer |
merging as rc |
Summary
The main goal is removing atomate dependencies from emmet, and transitioning from using
emmet.core.vasp.task_valid.TaskDocumement
toemmet.core.tasks.TaskDoc
. This will allow for eventual deprecation / aliasing ofTaskDocument
Completed:
Changes to
TaskDoc
and its fields are required since it is not directly compatible withTaskDocument
:TaskDocument
are deserialized, thusTaskDocument.calcs_reversed[:].input
will be a dict whereasTaskDocument.calcs_reversed[:].input
is aCalculationInput
object. Calling.model_dump()
doesn't help since this isn't recursive (e.g., the structure in CalculationInput will still be serialized)BaseCalculationModel
toemmet.core.calculation
which just wraps the pydanticBaseModel
with a.get
method to emulate dict key access (needed in the ValidationDoc)TaskDocument
:calc_type
,run_type
, and a post init update fortask_type
TaskDoc
accepts extra model input, and the way that pydantic looks for non-field attrs in the class, there are new private fields defined onTaskDoc
. pydantic first looks for attrs in the model extra field, but then raises anAttributeError
if it can't find it, without looking to see ifhasattr(class,attr)
. There's a longer explanation in a comment near_calc_type
Will be part of a separate PR:
## To Do:- Remove atomate dependence from emmet-cli:VaspCalcDb
--> generic maggma store- Improve credential handling in emmet-cli settings