mt_metadata icon indicating copy to clipboard operation
mt_metadata copied to clipboard

Schemas for objects

Open kkappler opened this issue 8 months ago • 0 comments

TLDR: I think this is being addressed in the pydantic upgrade underway, but wanted to document an issue I encountered while adding metadata about feature weighting during TF estimation.

I want to associate to each DecimationLevel a list of ChannelWeightSpec objects. These will have the same relationship with DecimationLevel as does the list of Bands. When I looked at how Bands is "wired into" DecimationLevel, I found something odd. It looks the way bands gets into DecimationLevel's attr_dict is via adding a block to the decimation_level.json like this

"bands": {
        "type": "integer",
        "required": true,
        "style": "name list",
        "units": null,
        "description": "List of bands",
        "options": [],
        "alias": [],
        "example": "[]",
		"default": null
    },

This schema does not appear to be technically correct, since the elements of the bands list are not integers, but Band objects.

It looks like this was a workaround that I used perhaps ...

In any case, it has been in place and working fine for some years now, and seems to be a way to plug-in an iterable of arbitrary objects to mt_metadata. I'm planning to use the same model for ChannelWeightSpec.

Is there a cleaner/better way to go about this?

kkappler avatar Apr 26 '25 15:04 kkappler