papermill icon indicating copy to clipboard operation
papermill copied to clipboard

parameters object

Open casperdcl opened this issue 5 years ago • 4 comments

perhaps it would be nice to provide an example where injected parameters are inside a dictionary or object:

# parameters
import argparse
args = argparse.Namespace()
args_dict = {}

args.a = 1
args_dict['b'] = 2
papermill ... -p args.a 1.618 -p "args_dict['b']" 3.14159

This would of course be useful for making transition between *.py scripts (using e.g. argparse or docopt) and *.ipynb notebooks (using papermill) easier

casperdcl avatar Jul 16 '19 16:07 casperdcl

You mean documenting something like papermill ... -y '{"args_dict": {"b": 3.14159}}'?

MSeal avatar Jul 16 '19 20:07 MSeal

yes

casperdcl avatar Jul 16 '19 20:07 casperdcl

That sounds useful to have. Maybe a full section in the docs on equivalent patterns between argparse, (click?), and papermill for passing argument.

MSeal avatar Jul 16 '19 21:07 MSeal

@rubelmusicwould8374 I deleted the adds you (hopefully unintentionally) injected into this thread. If you didn't know your account performed that action you may want to clean your computer / browser extensions :)

MSeal avatar Oct 17 '19 05:10 MSeal