mintproject / mic

Model Insertion Checker
https://mic-cli.readthedocs.io/en/latest/
5 stars 3 forks source link

parameters should be automatically in run.sh #254

Closed mosoriob closed 4 years ago

mosoriob commented 4 years ago

The parameters part is missing

Originally posted by @sirspock in https://github.com/mintproject/mic/issues/203#issuecomment-657736757

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.79. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

mosoriob commented 4 years ago

If the variable is a string. The result must be

./test.sh "${string_variable}
Cmheidelberg commented 4 years ago

How can we know how to map parameters to their mic.yaml values? If two parameters share the same value there is no way to automatically know which is which. (without some type of standardized way to declare parameters)

.
.
.
parameters:
  start_year:
    default_value: 2015
    type: int
    description: start year
  base_altitude:
    default_value: 2015
    type: int
    description: starting altitude in meters

invocation: ./my_script.py 2015 2015 input.csv current wrapper generated: ./my_script.py 2015 2015 ${input_csv} wrapper we want: ./my_script.py ${start_year} ${base_altitude} ${input_csv} or ./my_script.py ${int_variable_1} ${int_variable_2} ${input_csv}

mosoriob commented 4 years ago

The name of the variable is the key of the dictionary

 ./my_script.py ${start_year} ${base_altitude} ${input_csv}
mosoriob commented 4 years ago

Ups, I read it again. My previous comment was dumb.

mosoriob commented 4 years ago

The position is not a problem because you are going to detect the parameters from the command line invocation.

Cmheidelberg commented 4 years ago

So the user would type the invocation using the parameter's name (instead of value)?

dgarijo commented 4 years ago

In this particular case the user would have to edit the yaml file, as there is no way for us to determine which parameter goes where. I think the same thing would happen if we had the same file read twice in different inputs.

mosoriob commented 4 years ago

If you detect the parameters automatically, you don't have the problem

On Mon, Jul 13, 2020, 6:36 PM Daniel Garijo notifications@github.com wrote:

In this particular case the user would have to edit the yaml file, as there is no way for us to determine which parameter goes where. I think the same thing would happen if we had the same file read twice in different inputs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mintproject/mic/issues/254#issuecomment-657915293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASBUJRIJBS4L3FPUOXYXGTR3OZBBANCNFSM4OYYUW3A .

dgarijo commented 4 years ago

Maybe I am missing something, but if my invocation command is python myscript.py input1.csv input1.csv 5 5 5 5 How do I know which 5 is which parameter?

mosoriob commented 4 years ago

If you detect the parameters automatically. Then, you have an array with three values. P1, p2 and p3.

Next, you write in the mic.yaml.

On Mon, Jul 13, 2020, 6:51 PM Daniel Garijo notifications@github.com wrote:

Maybe I am missing something, but if my invocation command is python myscript.py input1.csv input1.csv 5 5 5 5 How do I know which 5 is which parameter?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mintproject/mic/issues/254#issuecomment-657919079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASBUJXDDKUCMGCYEDU2HELR3O22LANCNFSM4OYYUW3A .

mosoriob commented 4 years ago

Four values *

On Mon, Jul 13, 2020, 6:55 PM Maximiliano Osorio maxiosorio@gmail.com wrote:

If you detect the parameters automatically. Then, you have an array with three values. P1, p2 and p3.

Next, you write in the mic.yaml.

On Mon, Jul 13, 2020, 6:51 PM Daniel Garijo notifications@github.com wrote:

Maybe I am missing something, but if my invocation command is python myscript.py input1.csv input1.csv 5 5 5 5 How do I know which 5 is which parameter?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mintproject/mic/issues/254#issuecomment-657919079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASBUJXDDKUCMGCYEDU2HELR3O22LANCNFSM4OYYUW3A .

dgarijo commented 4 years ago

Right, that is the desired behavior indeed. Last time I checked this I had to change the values in src. I will have to retry again :)

Cmheidelberg commented 4 years ago

@sirspock just to make sure we are on the same page. If the user's invocation line is ./my_script.py 2015 2015 input.csv Then the auto generated invocation in run.sh should be ./my_script.py ${int_variable_1} ${int_variable_2} ${input_csv}?

Im just worried we will lose information about the parameter unless we ask the user for a name/ description of what each parameter is for.