Skip to content

Commit

Permalink
chore(holders): change example to float (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Oct 18, 2024
1 parent 8f28026 commit 8ba75ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openfisca_core/holders/holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def set_input(
>>> class MyVariable(variables.Variable):
... definition_period = periods.DateUnit.YEAR
... entity = entity
... value_type = int
... value_type = float
>>> variable = MyVariable()
Expand All @@ -201,11 +201,11 @@ def set_input(
>>> holder = Holder(variable, population)
>>> holder.set_input("2018", numpy.array([12.5, 14]))
>>> holder.get_array("2018")
array([12, 14], dtype=int32)
array([12.5, 14. ], dtype=float32)
>>> holder.set_input("2018", [12.5, 14])
>>> holder.get_array("2018")
array([12, 14], dtype=int32)
array([12.5, 14. ], dtype=float32)
.. _documentation:
https://openfisca.org/doc/coding-the-legislation/35_periods.html#set-input-automatically-process-variable-inputs-defined-for-periods-not-matching-the-definition-period
Expand Down

0 comments on commit 8ba75ca

Please sign in to comment.