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
I was thinking on some custom de-serializer, in such a way to provide AiiDA data which does not have a value property, i.e. which cannot be automatically serialized.
For example, I want to provide an orm.StructureData to a PythonJob, and this is not possible (we don't have the value property). So, I will not have the orm.StructureData node in the provenance of the job. But the AtomsData (if I want to use ASE in the job). This will somehow make provenance strange, as for the top level WorkGraph I will indeed have the orm.StructureData node. Examples are from here, check out the UndiAndKuboToyabe WG and the undi_runs PJob.
A simple solution would be to define, before the de-serialization (or during its action), the value attribute like this:
Then, s.value is just the ase.Atoms object which can be used in the PJob.
Is it a bit hacky maybe, and requires the user to know what he is doing. But actually, we can standardize it for several conversions (ASE, Pymatgen...) and provide documentation on how to test propertly.
This also means that we could then use the same structure node for different jobs, where different python objects (ASE, Pymatgen structures) can be used.
The text was updated successfully, but these errors were encountered:
I was thinking on some custom de-serializer, in such a way to provide AiiDA data which does not have a
value
property, i.e. which cannot be automatically serialized.For example, I want to provide an
orm.StructureData
to aPythonJob
, and this is not possible (we don't have thevalue
property). So, I will not have theorm.StructureData
node in the provenance of the job. But theAtomsData
(if I want to use ASE in the job). This will somehow make provenance strange, as for the top levelWorkGraph
I will indeed have theorm.StructureData
node. Examples are from here, check out theUndiAndKuboToyabe
WG and theundi_runs
PJob.A simple solution would be to define, before the de-serialization (or during its action), the
value
attribute like this:Then,
s.value
is just thease.Atoms
object which can be used in the PJob.Is it a bit hacky maybe, and requires the user to know what he is doing. But actually, we can standardize it for several conversions (ASE, Pymatgen...) and provide documentation on how to test propertly.
This also means that we could then use the same structure node for different jobs, where different python objects (ASE, Pymatgen structures) can be used.
The text was updated successfully, but these errors were encountered: