Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zhiyuli opened this issue Aug 21, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zhiyuli
Copy link
Contributor

zhiyuli commented Aug 21, 2022

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, ...)
@zhiyuli zhiyuli changed the title Allow to programmatically pre-fill values for model-specific parameters [FeatureRequest-IGUIDE]Allow to programmatically pre-fill values for model-specific parameters Aug 21, 2022
@zhiyuli zhiyuli added the enhancement New feature or request label Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants