Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Added JSONInit class to parambokeh #52

Merged
merged 8 commits into from
May 23, 2018
Merged

Added JSONInit class to parambokeh #52

merged 8 commits into from
May 23, 2018

Conversation

jlstevens
Copy link
Member

This PR adds the JSONInit class available in paramnb to parambokeh. The was this class is used is documented in this notebook and I will now check the corresponding invocation works with parambokeh.

@jlstevens
Copy link
Member Author

I've updated the JSONInit notebook to use parambokeh and added it to the user guide. I've also checked that this notebooks works as expected, accepting parameters at the commandline.

@jlstevens
Copy link
Member Author

@philippjfr @jbednar Ready to review/merge once the tests pass.

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from failing tests and one naming comment.

3. The JSON can be read directly from an environment variable.
Here is an easy example of setting such an environment variable on
the commandline:
PARAMBOKEH_INIT='{"p1":5}' jupyter notebook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be PARAM_INIT, so that user code doesn't depend on whether the author chose ParamNB or ParamBokeh?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Though this initializer is only supported by the widget systems (paramnnb/parambokeh). So how about PARAM_WIDGETS or similar?

Copy link
Member

@jbednar jbednar May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is currently only supported by the widget systems, but there is nothing about it that is related to widgets, so we can and should add something to Param that can consume it as well. I.e., the implementation should move to Param, and Param also needs an example of using it. But all those things are orthogonal; for now we just need a name that doesn't make any assumptions about how the declared values will be consumed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've chosen PARAM_JSON_INIT as that is the most accurate description of what it is.

@jlstevens
Copy link
Member Author

@ceball What should I use in setup.cfg to exclude JSONInit.ipynb?

@jlstevens
Copy link
Member Author

Looks like the notebook has now been excluded successfully and the tests should all go green.

@philippjfr
Copy link
Member

Looks good, I'll merge. What's the decision on moving this to param?

@philippjfr philippjfr merged commit 996dc42 into master May 23, 2018
@jlstevens
Copy link
Member Author

Thanks!

I think the decision is to move it to param in due course: #53

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants