Rocketsled example: `python basic.py` fails

When running the Rocketsled example with python basic.py, the following error message occurs:

2019-02-20 13:35:49,096 INFO Performing db tune-up
2019-02-20 13:35:50,717 INFO LaunchPad was RESET.
2019-02-20 13:35:50,790 INFO Optimization collection opt_default hard reset.
Traceback (most recent call last):
  File "basic.py", line 95, in <module>
    mc.configure(wf_creator=wf_creator, dimensions=x_dim)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/control.py", line 213, in configure
    wf_creator = serialize(wf_creator)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/utils.py", line 104, in serialize
    full_import_path = all_pkgs[-1] + "." + full_import_path
IndexError: list index out of range

It seems that this is because the function wf_creator should be defined in a separate file.
This is of course fine ; but it might be good to warn users on how to run the basic.py example.

(Note: I also modified the basic.py so as to have launchpad = LaunchPad.from_file('/Users/rlehe/.fireworks/my_launchpad.yaml'), but I don’t think that this is what causes the error.)

Hey Remi,

Thanks for letting us know. Think I know what the problem is (and how to fix it) - I’ll post an update on GitHub when it is fixed!

Thanks,

Alex

···

On Wednesday, February 20, 2019 at 1:49:07 PM UTC-8, Rémi Lehe wrote:

When running the Rocketsled example with python basic.py, the following error message occurs:

2019-02-20 13:35:49,096 INFO Performing db tune-up
2019-02-20 13:35:50,717 INFO LaunchPad was RESET.
2019-02-20 13:35:50,790 INFO Optimization collection opt_default hard reset.
Traceback (most recent call last):
  File "basic.py", line 95, in <module>
    mc.configure(wf_creator=wf_creator, dimensions=x_dim)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/control.py", line 213, in configure
    wf_creator = serialize(wf_creator)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/utils.py", line 104, in serialize
    full_import_path = all_pkgs[-1] + "." + full_import_path
IndexError: list index out of range

It seems that this is because the function wf_creator should be defined in a separate file.
This is of course fine ; but it might be good to warn users on how to run the basic.py example.

(Note: I also modified the basic.py so as to have launchpad = LaunchPad.from_file('/Users/rlehe/.fireworks/my_launchpad.yaml'), but I don’t think that this is what causes the error.)

Hey Remi,

See the fix here:

Does this fix the problem?

Thanks,

Alex

···

On Wednesday, February 20, 2019 at 1:49:07 PM UTC-8, Rémi Lehe wrote:

When running the Rocketsled example with python basic.py, the following error message occurs:

2019-02-20 13:35:49,096 INFO Performing db tune-up
2019-02-20 13:35:50,717 INFO LaunchPad was RESET.
2019-02-20 13:35:50,790 INFO Optimization collection opt_default hard reset.
Traceback (most recent call last):
  File "basic.py", line 95, in <module>
    mc.configure(wf_creator=wf_creator, dimensions=x_dim)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/control.py", line 213, in configure
    wf_creator = serialize(wf_creator)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/utils.py", line 104, in serialize
    full_import_path = all_pkgs[-1] + "." + full_import_path
IndexError: list index out of range

It seems that this is because the function wf_creator should be defined in a separate file.
This is of course fine ; but it might be good to warn users on how to run the basic.py example.

(Note: I also modified the basic.py so as to have launchpad = LaunchPad.from_file('/Users/rlehe/.fireworks/my_launchpad.yaml'), but I don’t think that this is what causes the error.)

Yes, that fixed the issue.
Thanks a lot!

···

On Wednesday, February 20, 2019 at 2:36:36 PM UTC-8, [email protected] wrote:

Hey Remi,

See the fix here:

https://github.com/hackingmaterials/rocketsled/commit/284b7020b9c974e8710f3f826489b85f7803dd99

Does this fix the problem?

Thanks,

Alex

On Wednesday, February 20, 2019 at 1:49:07 PM UTC-8, Rémi Lehe wrote:

When running the Rocketsled example with python basic.py, the following error message occurs:

2019-02-20 13:35:49,096 INFO Performing db tune-up
2019-02-20 13:35:50,717 INFO LaunchPad was RESET.
2019-02-20 13:35:50,790 INFO Optimization collection opt_default hard reset.
Traceback (most recent call last):
  File "basic.py", line 95, in <module>
    mc.configure(wf_creator=wf_creator, dimensions=x_dim)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/control.py", line 213, in configure
    wf_creator = serialize(wf_creator)
  File "/Users/rlehe/miniconda3/lib/python3.6/site-packages/rocketsled/utils.py", line 104, in serialize
    full_import_path = all_pkgs[-1] + "." + full_import_path
IndexError: list index out of range

It seems that this is because the function wf_creator should be defined in a separate file.
This is of course fine ; but it might be good to warn users on how to run the basic.py example.

(Note: I also modified the basic.py so as to have launchpad = LaunchPad.from_file('/Users/rlehe/.fireworks/my_launchpad.yaml'), but I don’t think that this is what causes the error.)