Skip to content

Commit

Permalink
Improve docstrings for public methods calling Parameters._update method.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Apr 14, 2019
1 parent 11bd52e commit 75deaa3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion taxcalc/consumption.py
Expand Up @@ -41,7 +41,8 @@ def update_consumption(self, revision,
print_warnings=True, raise_errors=True):
"""
Update consumption default values using specified revision dictionary.
(see Parameters._update for argument documentation.)
See Parameters._update for argument documentation and details about
the expected structure of the revision dictionary.
"""
self._update(revision, print_warnings, raise_errors)

Expand Down
3 changes: 2 additions & 1 deletion taxcalc/growdiff.py
Expand Up @@ -39,7 +39,8 @@ def update_growdiff(self, revision,
print_warnings=True, raise_errors=True):
"""
Update growdiff default values using specified revision dictionary.
(see Parameters._update for argument documentation.)
See Parameters._update for argument documentation and details about
the expected structure of the revision dictionary.
"""
self._update(revision, print_warnings, raise_errors)

Expand Down
13 changes: 10 additions & 3 deletions taxcalc/parameters.py
Expand Up @@ -246,6 +246,12 @@ def _update(self, revision_, print_warnings, raise_errors):
Parameters
----------
revision_: parameter-changes dictionary in param:year:value format
Each param primary key must be a string;
each year secondary key must be an integer; and
each value item must be either
a real/integer/boolean/string value for a scalar parameter
or
a list of real/integer/boolean/string values for a vector param.
print_warnings: boolean
if True, prints warnings when parameter_warnings exists;
Expand All @@ -261,9 +267,10 @@ def _update(self, revision_, print_warnings, raise_errors):
------
ValueError:
if revision_ is not a dictionary.
if each revision_ key is not a valid parameter name
if minimum YEAR in revision_ is less than current_year.
if maximum YEAR in revision_ is greater than end_year.
if each revision_ primary key is not a valid parameter name.
if each revision_ secondary key is not an integet.
if minimum year in revision_ is less than current_year.
if maximum year in revision_ is greater than end_year.
if _validate_names_types generates errors
if _validate_values generates errors and raise_errors is True
Expand Down
3 changes: 2 additions & 1 deletion taxcalc/policy.py
Expand Up @@ -103,7 +103,8 @@ def implement_reform(self, reform,
print_warnings=True, raise_errors=True):
"""
Implement specified policy reform and leave current_year unchanged.
(see Parameters._update for argument documentation.)
See Parameters._update for argument documentation and details about
the expected structure of the reform dictionary.
"""
self._update(reform, print_warnings, raise_errors)

Expand Down

0 comments on commit 75deaa3

Please sign in to comment.