|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## 44.5.0 |
| 4 | + |
| 5 | +#### New features |
| 6 | + |
| 7 | +- Add `as_of` attribute to `Variable` for persistent vector variables. |
| 8 | + - A variable declared with `as_of = True` (or `"start"` / `"end"`) stores its value at a given instant and automatically returns that value for any later period, until a new value is explicitly set — the vectorial analogue of OpenFisca parameters. |
| 9 | + - `as_of = "start"` (default when `True`): lookup uses the start of the requested period as reference instant. |
| 10 | + - `as_of = "end"`: lookup uses the end of the requested period (useful for annual variables like income tax). |
| 11 | + - Lookup is O(log P) via `bisect` on a sorted instants index. |
| 12 | + - Reference sharing: when consecutive stored values are identical, the same array object is reused, reducing memory usage for stable variables (e.g. `marital_status`, `housing_occupancy_status`). |
| 13 | + - Stored arrays are read-only (`writeable=False`) to prevent accidental in-place mutation. |
| 14 | + - Combining `as_of` with `set_input` dispatch helpers raises a `ValueError` at variable definition time. |
| 15 | + |
3 | 16 | ## 44.4.0 [#1364](https://github.com/openfisca/openfisca-core/pull/1364) |
4 | 17 |
|
5 | 18 | #### New features |
|
26 | 39 | - Added implicit links directly binding members arrays. This powers the new `population.links` property natively inside `TaxBenefitSystem.instantiate_entities()`. |
27 | 40 | - Full capability to chain relationships via python: `person.mother.household.get("rent", period)`. |
28 | 41 | - Powerful vectorized declarative aggregations out-of-the-box (e.g., `households.persons.sum("salary", period, condition=is_female)`). |
29 | | -- Add `as_of` attribute to `Variable` for persistent vector variables. |
30 | | - - A variable declared with `as_of = True` (or `"start"` / `"end"`) stores its value at a given instant and automatically returns that value for any later period, until a new value is explicitly set — the vectorial analogue of OpenFisca parameters. |
31 | | - - `as_of = "start"` (default when `True`): lookup uses the start of the requested period as reference instant. |
32 | | - - `as_of = "end"`: lookup uses the end of the requested period (useful for annual variables like income tax). |
33 | | - - Lookup is O(log P) via `bisect` on a sorted instants index. |
34 | | - - Reference sharing: when consecutive stored values are identical, the same array object is reused, reducing memory usage for stable variables (e.g. `marital_status`, `housing_occupancy_status`). |
35 | | - - Stored arrays are read-only (`writeable=False`) to prevent accidental in-place mutation. |
36 | | - - Combining `as_of` with `set_input` dispatch helpers raises a `ValueError` at variable definition time. |
37 | 42 |
|
38 | 43 | #### Technical changes |
39 | 44 |
|
|
0 commit comments