-
-
Notifications
You must be signed in to change notification settings - Fork 132
ParamTools #494
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
ParamTools #494
Conversation
|
|
||
| def test_update_specification_with_json(): | ||
| spec = Specifications() | ||
| new_spec_json = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hdoupe This test is not passing because the JSON is not specified properly:
if raise_errors and self._errors:
> raise self.validation_error
E paramtools.exceptions.ValidationError: {
E "frisch": [
E "Not a valid number: {'value': [{'value': 0.3}]}."
E ]
E }
../../ParamTools/paramtools/parameters.py:244: ValidationError
What is the proper format to use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work:
new_spec_json = """
{
"frisch": [{"value": 0.3}]
}
"""Since you're not using labels, you can simplify it to this:
new_spec_json = """
{
"frisch": 0.3
}
"""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - thanks @hdoupe.
|
@hdoupe When running OG-USA, I've been pickling the Is that right? Any work around? |
|
@jdebacker I found the source of the pickle problem, but I'm not sure how to solve it yet. I opened an issue in Paramtools: PSLmodels/ParamTools#78 I'll try to get a fix up for this today. |
|
@jdebacker what do you think about using The issue is that ParamTools dynamically creates Marshmallow classes dynamically using the |
|
@hdoupe Thanks for looking into the issue of being able to pickle the class object. I hadn't heard of
I'll do some more reading... |
Codecov Report
@@ Coverage Diff @@
## master #494 +/- ##
==========================================
- Coverage 64.96% 64.23% -0.73%
==========================================
Files 46 45 -1
Lines 5546 5366 -180
==========================================
- Hits 3603 3447 -156
+ Misses 1943 1919 -24
Continue to review full report at Codecov.
|
|
Ah, I agree. That statement was added in this PR cloudpipe/cloudpickle#127 in response to cloudpipe/cloudpickle#123. If you specify the default protocol, |
|
@hdoupe Ok - let me switch things to save the parameters class object with |
That's what I was thinking, too. If there are any shortcomings or you want to drop the use of |
|
@rickecon This PR passes all local tests and is ready for your review. |
|
The failing CI checks are all: E ModuleNotFoundError: No module named 'ogusa.parametersbase'stemming from the from ogusa.parametersbase import *It looks like |
Removed import parametersbase line from __init__.py
|
@rickecon Thanks for that PR. I removed a few other references to the old |
This PR updates the OG-USA
Specifications()class to inherit theParamTools.parameters()class.