Open giovannipizzi opened 5 years ago
Todo: discuss also what happens on export
This is not urgent but there should be a discussion on what should happen when extras are exported (and what is the behaviour of private extras). Issue #1761
After today's discussion we agreed:
get_aiida_extra() / get_aiida_extras()
2.2. set_aiida_extra() / set_aiida_extra()
2.3. reset_aiida_extras()
This will allow to avoid sometimes confusing interface due to the simultaneous managing of both types of extras.I'm also not sure at this point if we should really call them aiida_extra. maybe metadata, or some other name (and document the difference between attributes, extras, metadata)
Currently all extras are accessible to users. If AiiDA has to store custom data, that we don't necessarily want the user to change without noticing, we don't currently have a namespacing scheme to allow this. Two current occurrences of this are for instance the
hidden
flag of a code and thehash
of a Node (currently stored in extras but the user might inadvertently replace everything).Proposed solution
_aiida_
_aiida_core_
to AiiDA-core, and suggesting plugins to use_aiida_entrypoint_
for plugins (e.g._aiida_quantumespresso_
).get_extras(also_private=False)
where the newalso_private
flag,False
by default, establishes if key/value pairs starting with_aiida_
should be shown or not. (I chosealso_private
instead of, e.g.,show_private
because then the same name could be used also in the set methods, see below)get_extra()
should have the flag as well or not (my idea: not)set_extra(s)
would complain with an exception when setting a key starting with_aiida_
unless a flag is set,reset_extras
by default resets only extras without prefix, unless a flag is set)_aiida_
(that is currently done because the hashing mechasism would add "unexpected" extras).List of known internal extras
Code.hidden
: this is being used in import/export logicNode._aiida_hash
Node._aiida_cached_from