Skip to content

Improvement of MeasurementTool interface#225

Merged
JeanLucPons merged 1 commit intomainfrom
improve-measurement-tools
Mar 23, 2026
Merged

Improvement of MeasurementTool interface#225
JeanLucPons merged 1 commit intomainfrom
improve-measurement-tools

Conversation

@JeanLucPons
Copy link
Copy Markdown
Contributor

This PR improves doc and interface of MeasurementTool to allow free metadata to be added in MeasurementData.

# Callback example that adds free metadata in the MeasurementTool data.

def callback(action: Action, data:dict):
    src = data["source"]
    # Add metadata
    if isinstance(src,ChromaticityResponseMatrix) and action==Action.MEASURE:
        if "MyData" not in src.get():
            src.get()["MyData"] = []
        src.get()["MyData"].append(f"MyValue:{data["idx"]}") # Add a dummy value (the index here)
    return True

@JeanLucPons JeanLucPons merged commit 71d4765 into main Mar 23, 2026
3 checks passed
@JeanLucPons JeanLucPons deleted the improve-measurement-tools branch March 23, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants