Skip to content

[Idea]: User-friendly access to properties #840

@davidwaroquiers

Description

@davidwaroquiers

Problem

It would be nice to be able to access some deep-buried properties in a more user-friendly way.

One example is the magnetic density which can be accessed in the output document as: doc["output"]["calcs_reversed"][0]["output"]["mag_density"]

It is a bit "involved" and not easy to get for the average user.

Many properties are available as first level, e.g. density, bandgap, ... Of course, you don't want to have gazillions of those and only keep the most important ones.

Would something like that be a desirable/acceptable addition to emmet ?

This questioning came out while providing training and helping other users to use atomate2 (ergo emmet documents) and is somewhat difficult to explain where it is or provide an easy way to find where to find which information.

Proposed Solution

I would see two solutions:

  • Add help methods (or property methods) to access these properties. For example in the TaskDocument, have a magnetic_density property method that returns it directly (instead of having to know where it is, see above). The drawback is, how many methods/property methods will be added then ...
  • Add one helper method (e.g. get_property(property_name)) which would provide a way to access "any" (implemented) property/information a user would like to access.

Alternatives

Alternative is just to keep as is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions