nteract / papermill

📚 Parameterize, execute, and analyze notebooks
http://papermill.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
5.93k stars 426 forks source link

Injecting `pm` parameters breaks. #640

Open joshdunnlime opened 2 years ago

joshdunnlime commented 2 years ago

🐛 Bug

This works nicely for injecting params into the output_path (output name).

papermill template.ipynb analysis_{PARAM}.ipynb -p PARAM test_stuff

however, using pm['run_uuid'] breaks as does pm["run_uuid"] and pm[run_uuid]. It seems that python doesn't allow access to the pm object values in the "".format() syntax.

papermill template.ipynb analysis_{pm['run_uuid']}.ipynb

using pm alone works and prints the entire pm dict in the notebook output name, but it very messy!

See here for more info: https://github.com/nteract/papermill/pull/343

tfmark commented 2 years ago

What if you run:

papermill template.ipynb 'analysis_{pm["run_uuid"]}.ipynb' 

I wonder if the shell is doing something funky?