Skip to content

[FeatureRequest-IGUIDE]Allow to programmatically pre-fill values for model-specific parameters #45

@zhiyuli

Description

@zhiyuli

the manifest.json in model repo allows to specify model-specific parameters of different types, which will be rendered on SDK GUI.
Also, default values could be defined in manifest.json for each parameter.

For example:
https://github.com/cybergis/cybergis-compute-v2-wrfhydro/blob/main/manifest.json#L35

 "param_rules": {
        "Model_Version": {
            "type": "string_input",
            "require": true,
            "default_value": "v5.2.0"
        },
        "LSM_Type": {
            "type": "string_option",
            "options": ["Noah", "NoahMP"],
            "default_value": "NoahMP"
        },
        "Forcing_Path": {
            "type": "string_input",
            "require": true,
            "default_value": "<UPLOAD>"
        },
        "Merge_Output": {
            "type": "string_option",
            "options": ["True", "False"],
            "default_value": "True"
        }
    },

IGUIDE is developing a simple "chained jobs" usercase for wrfhydro where 2 different jobs will be run in order, and some of the model-specific parameters of the 2nd job are determined by the outputs or job properties of the 1st job.
Currently, two jobs can only act independently in one notebook, and notebook enduser has to manually provide correct parameter values in the UI (textbox/dropdown/slider...) of the 2nd job to match the outputs from the 1st job, which is error-prone.

I am proposing a new dictionary-type argument "model_params" for the create_job_by_ui() function in SDK
where notebook developer can programmatically pre-fill values for model-specific parameters

In the wrfhydro example, if notebook developer wants to pre-fill 2 of the model-specific parameters:

# this value has to be identical to that of Job1
# ??? what is the correct way to retrieve model parameter values given a job object?
LSM_Type = job1.param_LSM_Type

# this value contains jobid of Job1
Forcing_Path= "{Job1_ID}/forcing".format(job1.id)

model_params_prefill = {
                                        "LSM_Type": LSM_Type, 
                                        "Forcing_Path": Forcing_Path
                                      }
create_job_by_ui(..., model_params=model_params_prefill, ...)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions