Skip to content

ENH: ability to add datum metadata after datum creation #770

@MattMcClainStrive

Description

@MattMcClainStrive

Feature Type

  • Adding new functionality to valor

  • Changing existing functionality in valor

  • Removing existing functionality in valor

Problem Description

I would like to be able to add metadata to datums after the datums have been created. Before I see some examples of errors a model makes on my data, I may not know the types of metadata that will be relevant and I may not have the time to create all possible types of metadata.

Feature Description

Add new client functions that adds new metadata to a datum (or list of datums) in a dataset and finalizes the new metadata key.

def add_datum_metadata(dataset, datums, key, value):
"""
Parameters:
dataset: the Valor Dataset containing the datums
datums: List of Datums or datum_ids to add the metadata to
key: the metadata key to add
value: the metadata value to add

Adds metadata to datum(s) in a dataset. The metadata key must be new to the dataset to ensure that existing evaluations remain accurate. When metadata for all datums has been added, call finalize_dataset_metadata(dataset, key), which will prevent new metadata with that key from being added and allow filtering on the metadata key.
"""

def finalize_dataset_metadata(dataset, key):
"""
Parameters:
dataset: the Valor Dataset
key: the metadata key to finalize

Allows filtering based on the metadata key in this dataset and prevents new metadata with this key from being added.
"""

Additional Context

No response

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