Skip to content

Specifying arbitrary metadata #3816

@cstjean

Description

@cstjean

Is your feature request related to a problem? Please describe.

@mtkmodel is great, and I would like to use it to encode several user-specific metadata properties (for instance, I'd like to specify the DCS tag name corresponding to some variable).

I don't particularly care about this metadata being efficiently stored / accessed.

Describe the solution you’d like

I'd like to have syntax for arbitrary metadata. It is already possible to do it with misc

@parameters tau [misc=(; link="myurl", specifity=30)]

but that's not elegant, and hard to read for non-programmers. Ideally, I'd like:

@parameters tau [link="myurl", specifity=30]

that expands to @parameters tau [misc=(; link="myurl", specifity=30)], with some accessor like getmisc(tau, :link). In other words, all unknown parameters become misc named tuple fields.

Describe alternatives you’ve considered

@parameters tau [misc_link="myurl", misc_specifity=30]

would be uglier, but it would perhaps be more palatable for MTK.

Additional context

This is a straight-forward change, and I'd be happy to provide a PR if this is considered desirable. I get that this is breaking-ish.

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