Firwfork.from_file ID - can I change it so it's not always -1

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

Thanks,

Dan

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

···

Best,
Anubhav

(actually, don’t worry about making the ids negative yourself, just set whatever id you want, although FireWorks may reassign it as negative to prevent conflicts with existing fw_ids in your database)

···

On Friday, September 8, 2017 at 11:45:46 AM UTC-7, ajain wrote:

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

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

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

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/d69783db-f182-450d-b575-0b8cac47108e%40googlegroups.com.

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

Best,
Anubhav

Thanks again.

However, my problem is not resolved quite yet…

After I create the fws, I try to manually add them to a Workflow before adding that to the launchpad:

wf

= Workflow([fw1, fw2, fw3, fw4, fw5], {fw1:fw2, fw2:fw3, fw3:fw4, fw4:fw5},
name=“single stochastic workflow”)

Hence why I need the unique ids now. I tried hard-coding fw_id in the yaml, but it didn’t take. Where should that go in the yaml? Is there a better way to do this?

Thanks,

Dan

···

On Friday, September 8, 2017 at 12:45:46 PM UTC-6, ajain wrote:

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

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

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

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/d69783db-f182-450d-b575-0b8cac47108e%40googlegroups.com.

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

Best,
Anubhav

Try going through the example listed here:

https://materialsproject.github.io/fireworks/workflow_tutorial.html

···

On Fri, Sep 8, 2017 at 12:01 PM, Daniel Shaw [email protected] wrote:

Thanks again.

However, my problem is not resolved quite yet…

After I create the fws, I try to manually add them to a Workflow before adding that to the launchpad:

wf

= Workflow([fw1, fw2, fw3, fw4, fw5], {fw1:fw2, fw2:fw3, fw3:fw4, fw4:fw5},
name=“single stochastic workflow”)

Hence why I need the unique ids now. I tried hard-coding fw_id in the yaml, but it didn’t take. Where should that go in the yaml? Is there a better way to do this?

Thanks,

Dan

On Friday, September 8, 2017 at 12:45:46 PM UTC-6, ajain wrote:

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

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

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

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/d69783db-f182-450d-b575-0b8cac47108e%40googlegroups.com.

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

Best,
Anubhav

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/694c55bf-0bd4-4f3e-80d9-b53424bfedcc%40googlegroups.com.

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

Best,
Anubhav

From that link, I’ve got a very similar set-up to this:

from fireworks import Firework, Workflow, FWorker, LaunchPad, ScriptTask
from fireworks.core.rocket_launcher import rapidfire

# set up the LaunchPad and reset it
launchpad = LaunchPad()
launchpad.reset('', require_password=False)

# define four individual FireWorks used in the Workflow
task1 = ScriptTask.from_str('echo "Ingrid is the CEO."')
task2 = ScriptTask.from_str('echo "Jill is a manager."')
task3 = ScriptTask.from_str('echo "Jack is a manager."')
task4 = ScriptTask.from_str('echo "Kip is an intern."')

fw1 = Firework(task1)
fw2 = Firework(task2)
fw3 = Firework(task3)
fw4 = Firework(task4)

# assemble Workflow from FireWorks and their connections by id
workflow = Workflow([fw1, fw2, fw3, fw4], {fw1: [fw2, fw3], fw2: [fw4], fw3: [fw4]})

# store workflow and launch it locally
launchpad.add_wf(workflow)
rapidfire(launchpad, FWorker())

Yet I get all IDs = -1 and the process is dying when it tries to build the workflow…

···

On Friday, September 8, 2017 at 1:05:11 PM UTC-6, ajain wrote:

Try going through the example listed here:

https://materialsproject.github.io/fireworks/workflow_tutorial.html

On Fri, Sep 8, 2017 at 12:01 PM, Daniel Shaw [email protected] wrote:

Thanks again.

However, my problem is not resolved quite yet…

After I create the fws, I try to manually add them to a Workflow before adding that to the launchpad:

wf

= Workflow([fw1, fw2, fw3, fw4, fw5], {fw1:fw2, fw2:fw3, fw3:fw4, fw4:fw5},
name=“single stochastic workflow”)

Hence why I need the unique ids now. I tried hard-coding fw_id in the yaml, but it didn’t take. Where should that go in the yaml? Is there a better way to do this?

Thanks,

Dan

On Friday, September 8, 2017 at 12:45:46 PM UTC-6, ajain wrote:

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

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

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

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/d69783db-f182-450d-b575-0b8cac47108e%40googlegroups.com.

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

Best,
Anubhav

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/694c55bf-0bd4-4f3e-80d9-b53424bfedcc%40googlegroups.com.

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


Best,
Anubhav

Did you look at the example workflow YAML file it points to? I’ll paste it below for you:

···

On Fri, Sep 8, 2017 at 12:09 PM, Daniel Shaw [email protected] wrote:

From that link, I’ve got a very similar set-up to this:

from fireworks import Firework, Workflow, FWorker, LaunchPad, ScriptTask
from fireworks.core.rocket_launcher import rapidfire

# set up the LaunchPad and reset it
launchpad = LaunchPad()
launchpad.reset('', require_password=False)

# define four individual FireWorks used in the Workflow
task1 = ScriptTask.from_str('echo "Ingrid is the CEO."')
task2 = ScriptTask.from_str('echo "Jill is a manager."')
task3 = ScriptTask.from_str('echo "Jack is a manager."')
task4 = ScriptTask.from_str('echo "Kip is an intern."')

fw1 = Firework(task1)
fw2 = Firework(task2)
fw3 = Firework(task3)
fw4 = Firework(task4)

# assemble Workflow from FireWorks and their connections by id
workflow = Workflow([fw1, fw2, fw3, fw4], {fw1: [fw2, fw3], fw2: [fw4], fw3: [fw4]})

# store workflow and launch it locally
launchpad.add_wf(workflow)
rapidfire(launchpad, FWorker())

Yet I get all IDs = -1 and the process is dying when it tries to build the workflow…

On Friday, September 8, 2017 at 1:05:11 PM UTC-6, ajain wrote:

Try going through the example listed here:

https://materialsproject.github.io/fireworks/workflow_tutorial.html

On Fri, Sep 8, 2017 at 12:01 PM, Daniel Shaw [email protected] wrote:

Thanks again.

However, my problem is not resolved quite yet…

After I create the fws, I try to manually add them to a Workflow before adding that to the launchpad:

wf

= Workflow([fw1, fw2, fw3, fw4, fw5], {fw1:fw2, fw2:fw3, fw3:fw4, fw4:fw5},
name=“single stochastic workflow”)

Hence why I need the unique ids now. I tried hard-coding fw_id in the yaml, but it didn’t take. Where should that go in the yaml? Is there a better way to do this?

Thanks,

Dan

On Friday, September 8, 2017 at 12:45:46 PM UTC-6, ajain wrote:

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

On Fri, Sep 8, 2017 at 11:34 AM Daniel Shaw d[email protected] wrote:

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

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/d69783db-f182-450d-b575-0b8cac47108e%40googlegroups.com.

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

Best,
Anubhav

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/694c55bf-0bd4-4f3e-80d9-b53424bfedcc%40googlegroups.com.

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


Best,
Anubhav

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/a4b766cf-46a2-41f3-b88e-71c8a5c955cc%40googlegroups.com.

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


Best,
Anubhav

I set up my case this way, and it worked… sort of. The fw_id’s I assigned (11,12,13,14,15) were reassigned to (1,2,3,4,5) when I added the yaml task. What can I do about that (if anything)?

···

On Friday, September 8, 2017 at 1:11:48 PM UTC-6, ajain wrote:

Did you look at the example workflow YAML file it points to? I’ll paste it below for you:

=========

fws:

  • fw_id: 1

spec:

_tasks:

  • _fw_name: ScriptTask

script: echo ‘To be, or not to be,’

  • fw_id: 2

spec:

_tasks:

  • _fw_name: ScriptTask

script: echo ‘that is the question:’

links:

1:

  • 2

metadata: {}

=========

On Fri, Sep 8, 2017 at 12:09 PM, Daniel Shaw [email protected] wrote:

From that link, I’ve got a very similar set-up to this:

from fireworks import Firework, Workflow, FWorker, LaunchPad, ScriptTask
from fireworks.core.rocket_launcher import rapidfire

# set up the LaunchPad and reset it
launchpad = LaunchPad()
launchpad.reset('', require_password=False)

# define four individual FireWorks used in the Workflow
task1 = ScriptTask.from_str('echo "Ingrid is the CEO."')
task2 = ScriptTask.from_str('echo "Jill is a manager."')
task3 = ScriptTask.from_str('echo "Jack is a manager."')
task4 = ScriptTask.from_str('echo "Kip is an intern."')

fw1 = Firework(task1)
fw2 = Firework(task2)
fw3 = Firework(task3)
fw4 = Firework(task4)

# assemble Workflow from FireWorks and their connections by id
workflow = Workflow([fw1, fw2, fw3, fw4], {fw1: [fw2, fw3], fw2: [fw4], fw3: [fw4]})

# store workflow and launch it locally
launchpad.add_wf(workflow)
rapidfire(launchpad, FWorker())

Yet I get all IDs = -1 and the process is dying when it tries to build the workflow…

On Friday, September 8, 2017 at 1:05:11 PM UTC-6, ajain wrote:

Try going through the example listed here:

https://materialsproject.github.io/fireworks/workflow_tutorial.html

On Fri, Sep 8, 2017 at 12:01 PM, Daniel Shaw [email protected] wrote:

Thanks again.

However, my problem is not resolved quite yet…

After I create the fws, I try to manually add them to a Workflow before adding that to the launchpad:

wf

= Workflow([fw1, fw2, fw3, fw4, fw5], {fw1:fw2, fw2:fw3, fw3:fw4, fw4:fw5},
name=“single stochastic workflow”)

Hence why I need the unique ids now. I tried hard-coding fw_id in the yaml, but it didn’t take. Where should that go in the yaml? Is there a better way to do this?

Thanks,

Dan

On Friday, September 8, 2017 at 12:45:46 PM UTC-6, ajain wrote:

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

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

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

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/d69783db-f182-450d-b575-0b8cac47108e%40googlegroups.com.

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

Best,
Anubhav

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/694c55bf-0bd4-4f3e-80d9-b53424bfedcc%40googlegroups.com.

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


Best,
Anubhav

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/a4b766cf-46a2-41f3-b88e-71c8a5c955cc%40googlegroups.com.

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


Best,
Anubhav

Hi Daniel

There is no way to set the fw_ids yourself in the database. Fireworks will reassign them (and return back a map of what the reassigned ids are compared to the original ones).

Note that ids should not contain any meaningful information. That is in-line with best practices for ids. If there is any information about a Firework that you want to store for later querying, do not embed that information in the fw_id. Instead, modify the “spec” to have whatever tags, ids, etc. that you want to assign.

Note that once the fw_ids are in the database, you can safely assume that they won’t change.

Best,

Anubhav

···

On Mon, Sep 11, 2017 at 11:48 AM, Daniel Shaw [email protected] wrote:

I set up my case this way, and it worked… sort of. The fw_id’s I assigned (11,12,13,14,15) were reassigned to (1,2,3,4,5) when I added the yaml task. What can I do about that (if anything)?

On Friday, September 8, 2017 at 1:11:48 PM UTC-6, ajain wrote:

Did you look at the example workflow YAML file it points to? I’ll paste it below for you:

=========

fws:

  • fw_id: 1

spec:

_tasks:

  • _fw_name: ScriptTask

script: echo ‘To be, or not to be,’

  • fw_id: 2

spec:

_tasks:

  • _fw_name: ScriptTask

script: echo ‘that is the question:’

links:

1:

  • 2

metadata: {}

=========

On Fri, Sep 8, 2017 at 12:09 PM, Daniel Shaw [email protected] wrote:

From that link, I’ve got a very similar set-up to this:

from fireworks import Firework, Workflow, FWorker, LaunchPad, ScriptTask
from fireworks.core.rocket_launcher import rapidfire

# set up the LaunchPad and reset it
launchpad = LaunchPad()
launchpad.reset('', require_password=False)

# define four individual FireWorks used in the Workflow
task1 = ScriptTask.from_str('echo "Ingrid is the CEO."')
task2 = ScriptTask.from_str('echo "Jill is a manager."')
task3 = ScriptTask.from_str('echo "Jack is a manager."')
task4 = ScriptTask.from_str('echo "Kip is an intern."')

fw1 = Firework(task1)
fw2 = Firework(task2)
fw3 = Firework(task3)
fw4 = Firework(task4)

# assemble Workflow from FireWorks and their connections by id
workflow = Workflow([fw1, fw2, fw3, fw4], {fw1: [fw2, fw3], fw2: [fw4], fw3: [fw4]})

# store workflow and launch it locally
launchpad.add_wf(workflow)
rapidfire(launchpad, FWorker())

Yet I get all IDs = -1 and the process is dying when it tries to build the workflow…

On Friday, September 8, 2017 at 1:05:11 PM UTC-6, ajain wrote:

Try going through the example listed here:

https://materialsproject.github.io/fireworks/workflow_tutorial.html

On Fri, Sep 8, 2017 at 12:01 PM, Daniel Shaw [email protected] wrote:

Thanks again.

However, my problem is not resolved quite yet…

After I create the fws, I try to manually add them to a Workflow before adding that to the launchpad:

wf

= Workflow([fw1, fw2, fw3, fw4, fw5], {fw1:fw2, fw2:fw3, fw3:fw4, fw4:fw5},
name=“single stochastic workflow”)

Hence why I need the unique ids now. I tried hard-coding fw_id in the yaml, but it didn’t take. Where should that go in the yaml? Is there a better way to do this?

Thanks,

Dan

On Friday, September 8, 2017 at 12:45:46 PM UTC-6, ajain wrote:

Negative ids will be reassigned when entered into the launchpad so dont worry about it

If you really want to set ids yourself add a fw_id key in your YAML but suggest that you use negative ids. Follow tutorials for examples this should already be documented

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

This is a follow-on to the previous question I had today. I’m creating 5 fireworks from five different files. I’d like them to come back with unique IDs, but they all come back -1 (the call is Firework.from_file(filename)).
Is it possible to have these fireworks have different ids? How?

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/d69783db-f182-450d-b575-0b8cac47108e%40googlegroups.com.

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

Best,
Anubhav

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/694c55bf-0bd4-4f3e-80d9-b53424bfedcc%40googlegroups.com.

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


Best,
Anubhav

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/a4b766cf-46a2-41f3-b88e-71c8a5c955cc%40googlegroups.com.

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


Best,
Anubhav

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/dc02b380-ec56-4220-906c-6f2e6acc2cf8%40googlegroups.com.

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

Best,
Anubhav