Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline definition of LabelMeta aliases #3

Open
LandingEllipse opened this issue Feb 2, 2022 · 1 comment
Open

Streamline definition of LabelMeta aliases #3

LandingEllipse opened this issue Feb 2, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@LandingEllipse
Copy link
Contributor

LandingEllipse commented Feb 2, 2022

Some label attributes have multiple monikers associated to provide convenience aliases. For instance, in the PanCam meta map, both sub_instrument and camera point to .//psa:Sub-Instrument/psa:identifier. Currently, this results multiple KV pairs, which is a bit messy, and which anecdotally increases the threshold for defining aliases.

We could alternatively allow keys to be string tuples.
Pros:

  • Only one entry per label attribute; less room for mistakes
  • Cleaner communication of the availability of aliases; potentially easier to integrate with documentation

Cons:

  • Unclear what order the aliases should be in (though attribute name first seems sensible)
  • Loss of static key collision warnings (although this could be covered by a test)
  • Need to unpack the source meta map dict at runtime anyway
@LandingEllipse LandingEllipse added the enhancement New feature or request label Feb 2, 2022
@LandingEllipse
Copy link
Contributor Author

LandingEllipse commented Feb 2, 2022

Alternatively, if we're open to eating the loss of static checking and unpacking cons above, then we could go further: invert the map to deduplicate paths and play on the underlying structure. e.g.:

{
    "emrsp_rm:Mission": {
        "emrsp_rm:mars_sol": ("mars_sol", "sol"),
        "emrsp_rm:Experiment_Cycle": {
            "emrsp_rm:ec_number": ("ec_number", "ec_num"),
            "emrsp_rm:ec_phase": "ec_phase",
        },
        "emrsp_rm:vertical_survey_number": "vs_num",

    },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant