cybergis / cybergis-compute-python-sdk

https://cybergis.github.io/cybergis-compute-python-sdk
Apache License 2.0
5 stars 7 forks source link

Added run_jobs_using_params() #36

Closed mitkotak closed 5 months ago

mitkotak commented 2 years ago

Allows us to do something like

cybergis.run_job_using_params([{"input_a" : 50, "input_b" : "foo"}, {"input_a" : 100, "input_b" : "bar"}])
alexandermichels commented 2 years ago

@mitkotak I have two tasks on this PR:

  1. Can you check that this all still works with the big changes we pushed to the Core and SDK?
  2. Determine if this PR solves this issue: https://github.com/cybergis/cybergis-compute-python-sdk/issues/45

Thanks!

alexandermichels commented 2 years ago

Just tested this functionality out, It's pretty cool!

There are a few changes we need to make though. I think the way this will be used is to test a variety of parameters/settings to ensure that the job works, so reading from one hard-coded file isn't going to work. I think we should probably remove the code that reads from the JSON if the file exists.

Ideally the solution we want is for the user to provide a path to a JSON or a JSON loaded as a dict to a function like "run_job_using_params(...)" that takes in the dictionary of parameters and submits the job. I don't think we need to add it to the UI right now because this is mostly for model developers and the important part is that the functionality exists.

Other notes for when we come back to this functionality/future work (aka you don't need to do this for this PR):

  1. The save parameters button would be better if we could choose the path/filename, but that's okay for now. We will just have user's move the file/rename it themselves.
  2. Once we have a function like "run_job_using_params(...)" we will probably also want "run_jobs_using_params(...)" which takes a list of paths/dicts, submits each job, and when the job finishes, resets the UI and submits the next one.
  3. Eventually, we might want to make a "dev" flag in the "show_ui(..)" function which only shows the "Save Parameters" button and a tab for running many jobs if dev==True.