Skip to content

change: calibration results "sort_by_score" behaves gracefully if no score_name is given (single objective optim). #9

@jmp75

Description

@jmp75

Problem

Relates to csiro-hydroinformatics/wila#16.

If using a yaml string for weighted objectives, the objective name is not the yaml string. One needs to guess the objective name

From a python wrapper, JB reports:

OBJECTIVE_ID_STR = "[{ Name: 'NSE', Weight: 0.5 },{ Name: 'LogNSE', Weight: 0.5 }]"
objective_name = 'NSE:0.5,LogNSE:0.5'
[other code here...]
objective = sc.create_objective(f'{sc_id}.OutflowRate', masked_flow_df, OBJECTIVE_ID_STR, cal_start_date, cal_end_date)
[other code here to run the calibration...]
calib_results.sort_by_score(objective_name)

Desired solution

calib_results.sort_by_score("") should figure out the name of the objective to sort on if this is a single objective per scores.

Waiting for a fix upstream via csiro-hydroinformatics/wila#16, we can add python logic emulating this.

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