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
In a recent commit, the BackendNode interface and implementation was changed significantly with respect to attributes and extras. As a result, the values on unstored nodes are not cleaned until the node is stored. That means that unstored nodes can contain attributes and extras with uncleaned values. For example an unstored Dict node can contained stored Float nodes. This change becomes problematic in the implementation of _get_aiida_structure_pymatgen_inline and _get_aiida_structure_ase_inline of aiida.tools.data.cif. The parameters keyword argument can be an unstored Dict node, if the functions are run with store_provenance=False. Since it is unstored, it can contain stored nodes for the values within them. For example, the site_tolerance can be a stored Float. Since they are overloaded native float objects, they can be passed to pymatgens CifParser without it complaining. However, now whenever that class references the value, since it is a stored node, the ModelWrapper will cause the model instance to be refreshed from the database, which becomes prohibitively expensive. Simply calling clean_value on the parameters beforehand, will cause these nodes to be dereferenced into their base values, which solves the issue.
The text was updated successfully, but these errors were encountered:
In a recent commit, the
BackendNode
interface and implementation was changed significantly with respect to attributes and extras. As a result, the values on unstored nodes are not cleaned until the node is stored. That means that unstored nodes can contain attributes and extras with uncleaned values. For example an unstoredDict
node can contained storedFloat
nodes. This change becomes problematic in the implementation of_get_aiida_structure_pymatgen_inline
and_get_aiida_structure_ase_inline
ofaiida.tools.data.cif
. Theparameters
keyword argument can be an unstoredDict
node, if the functions are run withstore_provenance=False
. Since it is unstored, it can contain stored nodes for the values within them. For example, thesite_tolerance
can be a storedFloat
. Since they are overloaded native float objects, they can be passed to pymatgensCifParser
without it complaining. However, now whenever that class references the value, since it is a stored node, theModelWrapper
will cause the model instance to be refreshed from the database, which becomes prohibitively expensive. Simply callingclean_value
on theparameters
beforehand, will cause these nodes to be dereferenced into their base values, which solves the issue.The text was updated successfully, but these errors were encountered: