You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue outlines an interface that would ease the integration of OG-USA onto PolicyBrain:
JSON document containing model specifications (see taxcalc/current_law_policy.json for examples)
a. long name, parameter description to be displayed in the hover over box on PB, needs default value, type hints--integer_value or boolean_value (assumed to be float otherwise), range : {'min': min value, 'max': max value}, action on validating range--either stop or warn, warning message on violating
default_data -- returns a python dictionary containing the contents of the JSON document containing the model specifications (see taxcalc/parameters.default_data)
read_json_param_objects: final specification formatting (see taxcalc/calculator.read_json_param_objects)
a. PoliyBrain converts this dictionary {'param_name': 'raw input data', ...} to {'param_name': {'YEAR_i': 'parsed val_i', 'YEAR_j': 'parsed val_j', ...}, ...}. This dictionary is passed to read_json_param_objects for final formatting
reform_warnings_errors: provides error and warning messages given the parsed user input
a. takes input from read_json_param_objects and returns dictionary {'errors': 'new line separated error messages', 'warnings': 'new line separated warning messages'} (see taxcalc/tbi/tbi.reform_warnings_errors)
@jdebacker , if you can open up a PR for creating the JSON specifications object, we can work out how the different specifications can be mapped to the OG-USA parameters. Once this is set up, we can take a look at extending the taxcalc/parameters.py module to work with this document. My hunch is that once we get that connection setup the final formatting and warning/error handling will fall into place as we can borrow parts of the taxcalc warning and error handling code.
Also, the API endpoint names are flexible. These are just taken from Tax-Calculator for simplicity.
The text was updated successfully, but these errors were encountered:
This issue outlines an interface that would ease the integration of OG-USA onto PolicyBrain
The general approach Hank is suggesting here seems very reasonable.
If you can do something like this, the OG-USA code and PolicyBrain code will be much simpler.
This issue outlines an interface that would ease the integration of OG-USA onto PolicyBrain:
taxcalc/current_law_policy.json
for examples)a. long name, parameter description to be displayed in the hover over box on PB, needs default value, type hints--
integer_value
orboolean_value
(assumed to be float otherwise), range :{'min': min value, 'max': max value}
, action on validating range--eitherstop
orwarn
, warning message on violatingdefault_data
-- returns a python dictionary containing the contents of the JSON document containing the model specifications (seetaxcalc/parameters.default_data
)read_json_param_objects
: final specification formatting (seetaxcalc/calculator.read_json_param_objects
)a. PoliyBrain converts this dictionary
{'param_name': 'raw input data', ...}
to{'param_name': {'YEAR_i': 'parsed val_i', 'YEAR_j': 'parsed val_j', ...}, ...}
. This dictionary is passed toread_json_param_objects
for final formattingreform_warnings_errors
: provides error and warning messages given the parsed user inputa. takes input from
read_json_param_objects
and returns dictionary{'errors': 'new line separated error messages', 'warnings': 'new line separated warning messages'}
(seetaxcalc/tbi/tbi.reform_warnings_errors
)@jdebacker , if you can open up a PR for creating the JSON specifications object, we can work out how the different specifications can be mapped to the OG-USA parameters. Once this is set up, we can take a look at extending the
taxcalc/parameters.py
module to work with this document. My hunch is that once we get that connection setup the final formatting and warning/error handling will fall into place as we can borrow parts of the taxcalc warning and error handling code.Also, the API endpoint names are flexible. These are just taken from Tax-Calculator for simplicity.
The text was updated successfully, but these errors were encountered: