Using ScriptTask.from_file(yaml_file) throws "required parameter script not specified"

In my script, these two lines:

yamlcubit =

“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/pywrappers/firetasks/cubi_task.yaml”

cubit_firetask = ScriptTask.from_file(yamlcubit)

throw the following error:

File
“mead.py”, line 127, in
cubit_firetask = ScriptTask.from_file(yamlcubit)
File “/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 293, in from_file
return cls.from_format(f.read(), f_format=f_format)
File
“/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 261, in from_format
yaml.load(f_str, Loader=Loader)))
File
“/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 163, in _decorator
m_dict = func(self, *new_args, **kwargs)
File “/usr/lib64/python2.7/site-packages/fireworks/core/firework.py”,
line 101, in from_dict
return cls(m_dict)
File
“/usr/lib64/python2.7/site-packages/fireworks/core/firework.py”, line
51, in call
raise ValueError("{}: Required parameter {} not
specified!".format(cls, k))ValueError: <class ‘fireworks.user_objects.firetasks.script_task.ScriptTask’>:
Required parameter script not specified!

The yaml file looks like:

spec:

_tasks:

    - _fw_name: PyTask

      func: update_cubit.main

      stored_data_varname:

“cubit_metadata”

      kwargs:

{“cubitfile”:
“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/inputs/testbox.py”,
“var_names”: {“1”: “deltay”, “0”:
“deltax”, “2”: “deltaz”}, “errfile”:
“cubit.err”, “var_values”: "
1.14999999999999991e-01 1.04999999999999996e-01
9.50000000000000011e-02 \n", “exofile”:
“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/inputs/testbox.exo”}

_pass_job_info: True

Now, I’ve been going through the documentation trying to sort this out but have not had any success yet. Does anyone know what is causing this ValueError and, more importantly, what I can do to fix it? If you need any more info from me. just let me know.

Thanks,

Dan

I am pretty sure you are trying to create a Firework, not a Firetask (and in particular, definitely not trying to create a ScriptTask since your YAML file is about a PyTask)

So I think what you need is:

cubit_fw = Firework.from_file(yamlcubit)
···

On Fri, Sep 8, 2017 at 6:56 AM, Daniel Shaw [email protected] wrote:

In my script, these two lines:

yamlcubit =

“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/pywrappers/firetasks/cubi_task.yaml”

cubit_firetask = ScriptTask.from_file(yamlcubit)

throw the following error:

File
“mead.py”, line 127, in
cubit_firetask = ScriptTask.from_file(yamlcubit)
File “/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 293, in from_file
return cls.from_format(f.read(), f_format=f_format)
File
“/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 261, in from_format
yaml.load(f_str, Loader=Loader)))
File
“/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 163, in _decorator
m_dict = func(self, *new_args, **kwargs)
File “/usr/lib64/python2.7/site-packages/fireworks/core/firework.py”,
line 101, in from_dict
return cls(m_dict)
File
“/usr/lib64/python2.7/site-packages/fireworks/core/firework.py”, line
51, in call
raise ValueError("{}: Required parameter {} not
specified!".format(cls, k))
ValueError: <class ‘fireworks.user_objects.firetasks.script_task.ScriptTask’>:
Required parameter script not specified!

The yaml file looks like:

spec:

_tasks:

    - _fw_name: PyTask

      func: update_cubit.main

      stored_data_varname:

“cubit_metadata”

      kwargs:

{“cubitfile”:
“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/inputs/testbox.py”,
“var_names”: {“1”: “deltay”, “0”:
“deltax”, “2”: “deltaz”}, “errfile”:
“cubit.err”, “var_values”: "
1.14999999999999991e-01 1.04999999999999996e-01
9.50000000000000011e-02 \n", “exofile”:
“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/inputs/testbox.exo”}

_pass_job_info: True

Now, I’ve been going through the documentation trying to sort this out but have not had any success yet. Does anyone know what is causing this ValueError and, more importantly, what I can do to fix it? If you need any more info from me. just let me know.

Thanks,

Dan

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/edb091a3-ae90-4416-85e6-b24c02761a4d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Best,
Anubhav

It worked, I’ve got a quick follow-up. I create a firework.from_file 5 times and each time the id=-1. How do I set it up so that to generate unique IDs?

Thanks,

Dan

···

On Friday, September 8, 2017 at 9:52:05 AM UTC-6, ajain wrote:

I am pretty sure you are trying to create a Firework, not a Firetask (and in particular, definitely not trying to create a ScriptTask since your YAML file is about a PyTask)

So I think what you need is:

cubit_fw = Firework.from_file(yamlcubit)

On Fri, Sep 8, 2017 at 6:56 AM, Daniel Shaw [email protected] wrote:

In my script, these two lines:

yamlcubit =

“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/pywrappers/firetasks/cubi_task.yaml”

cubit_firetask = ScriptTask.from_file(yamlcubit)

throw the following error:

File
“mead.py”, line 127, in
cubit_firetask = ScriptTask.from_file(yamlcubit)
File “/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 293, in from_file
return cls.from_format(f.read(), f_format=f_format)
File
“/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 261, in from_format
yaml.load(f_str, Loader=Loader)))
File
“/usr/lib64/python2.7/site-packages/fireworks/utilities/fw_serializers.py”,
line 163, in _decorator
m_dict = func(self, *new_args, **kwargs)
File “/usr/lib64/python2.7/site-packages/fireworks/core/firework.py”,
line 101, in from_dict
return cls(m_dict)
File
“/usr/lib64/python2.7/site-packages/fireworks/core/firework.py”, line
51, in call
raise ValueError("{}: Required parameter {} not
specified!".format(cls, k))
ValueError: <class ‘fireworks.user_objects.firetasks.script_task.ScriptTask’>:
Required parameter script not specified!

The yaml file looks like:

spec:

_tasks:

    - _fw_name: PyTask

      func: update_cubit.main

      stored_data_varname:

“cubit_metadata”

      kwargs:

{“cubitfile”:
“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/inputs/testbox.py”,
“var_names”: {“1”: “deltay”, “0”:
“deltax”, “2”: “deltaz”}, “errfile”:
“cubit.err”, “var_values”: "
1.14999999999999991e-01 1.04999999999999996e-01
9.50000000000000011e-02 \n", “exofile”:
“/home/Synclesis/Projects/STTR_A15A-T004/Sandboxes/dshaw/fireflow/inputs/testbox.exo”}

_pass_job_info: True

Now, I’ve been going through the documentation trying to sort this out but have not had any success yet. Does anyone know what is causing this ValueError and, more importantly, what I can do to fix it? If you need any more info from me. just let me know.

Thanks,

Dan

You received this message because you are subscribed to the Google Groups “fireworkflows” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

Visit this group at https://groups.google.com/group/fireworkflows.

To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/edb091a3-ae90-4416-85e6-b24c02761a4d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Best,
Anubhav