Skip to content

Drop output_ prefix in output ports #950

@mbercx

Description

@mbercx

Currently a lot of the outputs have output_ as a prefix in their port names, e.g.:

spec.output('output_parameters', valid_type=orm.Dict,
help='The `output_parameters` output node of the successful calculation.')
spec.output('output_structure', valid_type=orm.StructureData, required=False,
help='The `output_structure` output node of the successful calculation if present.')
spec.output('output_trajectory', valid_type=orm.TrajectoryData, required=False)
spec.output('output_band', valid_type=orm.BandsData, required=False,
help='The `output_band` output node of the successful calculation if present.')
spec.output('output_kpoints', valid_type=orm.KpointsData, required=False)
spec.output('output_atomic_occupations', valid_type=orm.Dict, required=False)
spec.default_output_node = 'output_parameters'

This is a bit redundant. It means we have to type e.g.:

pw_calc.outputs.output_parameters

Instead of just having

pw_calc.outputs.parameters

I think the second is:

  1. More intuitive.
  2. Shorter and hence more readable. It's still perfectly clear but there is no distracting duplicate ouput.
  3. Faster to tab complete. I can just do pw_calc.p+ Tab and get the output I want.

So I vote we remove all these output_ prefixes everywhere. Clearly this would be a backwards-incompatible change. @sphuber do you see an elegant deprecation pathway, e.g. keeping both output ports and raising a warning if the deprecated one is accessed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions