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
Hi,
Using the Accessing nested tables tutorial as a base, I'm trying to understand how call get_value child variable works when the requested section is missing.
When editing the example toml file for the above tutorial to rename the hamiltonian section to something else (eg. [foobar.dftb]) the code runs with out displaying the expected error message "No hamiltonian section found in input file". Is there a bug in get_value and child is always associated? Or am I just misunderstaning how the tutorial code works?
The text was updated successfully, but these errors were encountered:
The get_value interface will eagerly create missing child tables in the root table unless the requested=.false. option is provided, i.e.requested defaults to .true. if not provided. In this (default) case the child table is only not associated if the key is associated with something else than a table, like
The get_value interface can distinguish between success (table present or table created) and failure (non-table value) by association status in this case.
If requested=.false. is set as for the second part of the recipe, the child pointer will only be associated to a table if it was previously present. Note that this will fail with a non-zero stat value for the provided example
In this case the child pointer will be unassociated as well, however we have three possible states, success and pointer associated (table present), success and pointer unassociated (table absent) and failure and pointer unassociated (non-table value).
If this explanation helps I can incorporate it with the recipe in the docs.
Hi,
Using the Accessing nested tables tutorial as a base, I'm trying to understand how call get_value child variable works when the requested section is missing.
When editing the example toml file for the above tutorial to rename the hamiltonian section to something else (eg. [foobar.dftb]) the code runs with out displaying the expected error message "No hamiltonian section found in input file". Is there a bug in get_value and child is always associated? Or am I just misunderstaning how the tutorial code works?
The text was updated successfully, but these errors were encountered: