Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it simple to work with simple parameters #45

Merged
merged 3 commits into from Apr 23, 2019

Conversation

Projects
None yet
1 participant
@hdoupe
Copy link
Collaborator

commented Apr 22, 2019

See #43.

With this change, one can do an adjustment via:

In [1]: import paramtools 
   ...: class Params(paramtools.Parameters): 
   ...:     schema = "paramtools/tests/schema.json" 
   ...:     defaults = "paramtools/tests/defaults.json" 
   ...: params = Params() 
   ...:                                                                                                                       

In [2]: params.int_default_param                                                                                              
Out[2]: [{'value': 2}]

In [3]: params.adjust({ 
   ...:     "int_default_param": 4, 
   ...: })                                                                                                                    

In [4]: params.int_default_param                                                                                              
Out[4]: [{'value': 4}]

In [5]:                                                                                                                       

The same logic applies for the JSON defaults file.

@hdoupe hdoupe referenced this pull request Apr 23, 2019

Open

Simplifying changes #43

@hdoupe hdoupe merged commit 7288c96 into master Apr 23, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@hdoupe hdoupe deleted the simple-value branch Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.