Skip to content

Releases: PSLmodels/ParamTools

ParamTools 0.18.1

03 Apr 16:17
Compare
Choose a tag to compare
  • Fix bug when using a when validator with defer_validation. (#127)

ParamTools 0.18.0

05 Feb 17:21
Compare
Choose a tag to compare
  • Allow comments in JSON files. (#124)
In [1]: import paramtools                                                           

In [2]: s = """// this is my json file 
   ...: // more comments here 
   ...: /* 
   ...: multi line comments? 
   ...: */ 
   ...: { 
   ...:     "hello": "world", 
   ...:     "allows_urls": "http://double-slash-is-ok.com" 
   ...: }"""                                                                        

In [3]: paramtools.read_json(s)                                                     
Out[3]: 
OrderedDict([('hello', 'world'),
             ('allows_urls', 'http://double-slash-is-ok.com')])

ParamTools 0.17.0

25 Jan 22:54
Compare
Choose a tag to compare
  • Add transaction method for multi-stage updates. (#123)
    Screenshot from 2021-01-25 17-53-08
  • Use Github Actions for CI. (#123)

ParamTools 0.16.0

28 Oct 15:02
Compare
Choose a tag to compare
  • New API for querying parameter values:
    Screenshot from 2020-10-28 11-00-59

  • Improvements for querying custom/nested values:
    Screenshot from 2020-10-28 11-02-22

ParamTools 0.15.1

02 Sep 12:40
Compare
Choose a tag to compare
  • Fix several ordering bugs affecting the order of schema vs parameter names in the output of Parameters.dump and the order of keys in value objects. (#115)
  • Expose argument to use the labels set in the state of the Parameters instance when selecting which values to include when calling Parameters.dump. (#115)
  • Use most up-to-date operator values when dumping a Parameter values to JSON. (#118)

ParamTools 0.15.0

28 Jul 14:11
Compare
Choose a tag to compare
  • Use fsspec to support a rich variety of inputs sources from local JSON files to files stored on GitHub, S3, or Google Cloud Storage. (#111, #113)

ParamTools 0.14.2

29 Jun 14:06
Compare
Choose a tag to compare
  • Fix deserialization bug. (#109)

ParamTools 0.14.1

04 May 15:53
Compare
Choose a tag to compare
  • Perfomance improvements to extend functionality. (#107)
  • Bug fix for sort_values that caused an error when calling dump on a Parameters instance that does not specify any labels. (#108)

ParamTools 0.14.0

01 May 17:45
Compare
Choose a tag to compare
  • Add the _auto attribute to parameter values that were extended automatically. This make it possible to update the rules for how parameters should be extended, delete the extended values, and update with the new rules (#102):
# Update extension rules:
offset = 0.0025
for year, rate in params.index_rates.items():
    params.index_rates[year] = rate + offset

# Select automatically created values:
automatically_added = params.select_eq(
    "standard_deduction", strict=True, _auto=True
)

# Delete automatically created values and replace using the new rules:
params.delete(
    {
        "standard_deduction": automatically_added
    }
)
  • Add a clobber argument to the adjust method that allows you to toggle whether user-defined values should be overridden while doing an adjustment in extend mode. (#102)

  • Bug fixes for corner cases in logic for extending parameter values. (#103)

  • API change in extend method to use more concise keyword arguments. The argument label_to_extend is now label and the label_to_extend_values is now label_values. (#103)

  • Ability to specify the state to be used when converting between lists of value objects and arrays (#105):

# Select standard_deduction values in years 2014 and 2015
In [2]: params.to_array("standard_deduction", year=[2014, 2015])                                                                                                                              
Out[2]: 
array([[13673.68, 27347.36],
       [13673.68, 27347.36]])

# Convert standard_deduction values to a numpy array and back to a list of value objects:
In [3]: params.from_array( 
   ...:     "standard_deduction", 
   ...:     params.to_array("standard_deduction", year=[2014, 2015]), 
   ...:     year=[2014, 2015] 
   ...: )                                                                                                                                                                                     
Out[3]: 
[{'year': 2014, 'marital_status': 'single', 'value': 13673.68},
 {'year': 2014, 'marital_status': 'joint', 'value': 27347.36},
 {'year': 2015, 'marital_status': 'single', 'value': 13673.68},
 {'year': 2015, 'marital_status': 'joint', 'value': 27347.36}]
  • Bug fix for overriding the ops values like array_first or label_to_extend when initializing a Parameters instance (#104):
params = Params(array_first=False, label_to_extend=None)
  • Fixes bug in sort_values method that occurs when using it in conjunction with set_state (#106):
In [1]: from taxcalc import Policy 
   ...: pol = Policy(array_first=False) 
   ...: pol.select_eq("STD", strict=False, year=[2021]) 
   ...: pol.set_year([2018, 2019, 2020, 2021])                                                                                                                                                

In [2]: d = pol.sort_values()                                                                                                                                                                 

In [3]: pol.STD                                                                                                                                                                               
Out[3]: 
[{'MARS': 'single', 'value': 12000.0, 'year': 2018},
 {'MARS': 'mjoint', 'value': 24000.0, 'year': 2018},
 {'MARS': 'mseparate', 'value': 12000.0, 'year': 2018},
 {'MARS': 'headhh', 'value': 18000.0, 'year': 2018},
 {'MARS': 'widow', 'value': 24000.0, 'year': 2018},
 {'MARS': 'single', 'value': 12200.0, 'year': 2019},
 {'MARS': 'mjoint', 'value': 24400.0, 'year': 2019},
 {'MARS': 'mseparate', 'value': 12200.0, 'year': 2019},
 {'MARS': 'headhh', 'value': 18350.0, 'year': 2019},
 {'MARS': 'widow', 'value': 24400.0, 'year': 2019},
 {'MARS': 'single', 'value': 12392.76, 'year': 2020, '_auto': True},
 {'MARS': 'mjoint', 'value': 24785.52, 'year': 2020, '_auto': True},
 {'MARS': 'mseparate', 'value': 12392.76, 'year': 2020, '_auto': True},
 {'MARS': 'headhh', 'value': 18639.93, 'year': 2020, '_auto': True},
 {'MARS': 'widow', 'value': 24785.52, 'year': 2020, '_auto': True},
 {'MARS': 'single', 'value': 12662.92, 'year': 2021, '_auto': True},
 {'MARS': 'mjoint', 'value': 25325.84, 'year': 2021, '_auto': True},
 {'MARS': 'mseparate', 'value': 12662.92, 'year': 2021, '_auto': True},
 {'MARS': 'headhh', 'value': 19046.28, 'year': 2021, '_auto': True},
 {'MARS': 'widow', 'value': 25325.84, 'year': 2021, '_auto': True}]

ParamTools 0.13.1

16 Apr 22:17
Compare
Choose a tag to compare
  • Make integer validation strict so that floats are now invalid. (#98)
  • Fixes bug where errors were not raised when passing a list value to a non-list parameter. (#99)
  • Fix error messages for labels. (#100)