Skip to content

Commit bd8a59e

Browse files
committed
Review finished.
1 parent 09c1b29 commit bd8a59e

23 files changed

Lines changed: 124 additions & 310 deletions

src/gettsim/germany/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@
66

77
ROOT_PATH = Path(__file__).parent
88

9-
# Germany's unit system, built on import so the [currency] dimension has concrete
10-
# currencies and the fluent builder offers `TTSIMUnit.X.PER_HH` / `per_bg` / … before
11-
# the policy modules (whose decorators use them) are loaded (GEP 10). The euro is
12-
# the base currency; the Deutsche Mark is worth 1/1.95583 euro, the rate fixed by
13-
# the Euro-Einführungsgesetz. The statutory-currency mapping tells the engine
14-
# which currency each policy date computes in: the Deutsche Mark through 2001 and
15-
# the euro from 2002, when the euro became legal tender. Parameters are never
16-
# converted (GEP 10) — every pre-2002 currency value carries its statutory DM
17-
# amount, every value from 2002 its statutory euro amount.
9+
1810
UNIT_SYSTEM = UnitSystem(
1911
base_currency="EUR",
2012
other_currencies={"DM": "EUR / 1.95583"},

src/gettsim/germany/inputs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def geburtsjahr() -> int:
3232
"""Birth year."""
3333

3434

35-
@policy_input(unit=TTSIMUnit.DIMENSIONLESS)
35+
@policy_input(unit=TTSIMUnit.CALENDAR_MONTH)
3636
def geburtsmonat() -> int:
3737
"""Month of birth (within year)."""
3838

3939

40-
@policy_input(unit=TTSIMUnit.DIMENSIONLESS)
40+
@policy_input(unit=TTSIMUnit.CALENDAR_DAY)
4141
def geburtstag() -> int:
4242
"""Day of birth (within month)."""
4343

@@ -57,6 +57,6 @@ def weiblich() -> bool:
5757
"""Female."""
5858

5959

60-
@policy_input(end_date="2024-12-31", unit=TTSIMUnit.DIMENSIONLESS)
60+
@policy_input(end_date="2024-12-31", unit=TTSIMUnit.DIMENSIONLESS.PER_HH)
6161
def wohnort_ost_hh() -> bool:
6262
"""Whether the household is located in the new Länder (Beitrittsgebiet)."""

src/gettsim/germany/sozialversicherung/kranken/beitrag/selbstständige.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ bezugsgröße_selbstständige_m:
66
description:
77
de: §18 SGB IV ynd https://de.wikipedia.org/wiki/Bezugsgr%C3%B6%C3%9Fe
88
en: §18 SGB IV and https://de.wikipedia.org/wiki/Bezugsgr%C3%B6%C3%9Fe
9-
unit: EUR_PER_MONTH
109
type: scalar
1110
1984-01-01:
1211
unit: DM_PER_MONTH
@@ -41,7 +40,6 @@ bezugsgröße_selbstständige_nach_wohnort:
4140
description:
4241
de: §18 SGB IV und https://de.wikipedia.org/wiki/Bezugsgr%C3%B6%C3%9Fe
4342
en: §18 SGB IV and https://de.wikipedia.org/wiki/Bezugsgr%C3%B6%C3%9Fe
44-
unit: EUR_PER_MONTH
4543
type: dict
4644
add_jahresanfang: true
4745
1990-01-01:

src/gettsim/germany/sozialversicherung/midijob.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def in_gleitzone(
2424
)
2525

2626

27-
@policy_function(verify_units=False, unit=TTSIMUnit.CURRENCY.PER_MONTH)
27+
@policy_function(unit=TTSIMUnit.CURRENCY.PER_MONTH)
2828
def beitragspflichtige_einnahmen_aus_midijob_arbeitnehmer_m(
2929
einnahmen__bruttolohn_m: float,
3030
minijobgrenze_m: float,
@@ -42,7 +42,6 @@ def beitragspflichtige_einnahmen_aus_midijob_arbeitnehmer_m(
4242

4343

4444
@param_function(
45-
verify_units=False,
4645
start_date="2003-04-01",
4746
end_date="2004-12-31",
4847
leaf_name="midijob_faktor_f",
@@ -86,7 +85,6 @@ def midijob_faktor_f_mit_minijob_steuerpauschale_bis_2004(
8685

8786

8887
@param_function(
89-
verify_units=False,
9088
start_date="2005-01-01",
9189
end_date="2022-09-30",
9290
leaf_name="midijob_faktor_f",
@@ -130,7 +128,6 @@ def midijob_faktor_f_mit_minijob_steuerpauschale_ab_2005_bis_2022_09(
130128

131129

132130
@param_function(
133-
verify_units=False,
134131
start_date="2022-10-01",
135132
leaf_name="midijob_faktor_f",
136133
unit=TTSIMUnit.DIMENSIONLESS,
@@ -176,7 +173,6 @@ def midijob_faktor_f_ohne_minijob_steuerpauschale(
176173

177174

178175
@policy_function(
179-
verify_units=False,
180176
start_date="2003-04-01",
181177
end_date="2022-09-30",
182178
leaf_name="midijob_bemessungsentgelt_m",
@@ -208,7 +204,6 @@ def midijob_bemessungsentgelt_m_bis_09_2022(
208204

209205

210206
@policy_function(
211-
verify_units=False,
212207
start_date="2022-10-01",
213208
leaf_name="midijob_bemessungsentgelt_m",
214209
unit=TTSIMUnit.CURRENCY.PER_MONTH,

src/gettsim/germany/sozialversicherung/minijob.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ minijobgrenze_m:
66
description:
77
de: Minijob § 8 (1) Nr. 1 SGB IV
88
en: Minijob § 8 (1) Nr. 1 SGB IV
9-
unit: EUR_PER_MONTH
109
type: scalar
1110
1984-01-01:
1211
unit: DM_PER_MONTH
@@ -44,10 +43,9 @@ parameter_minijobgrenze_ost_west_unterschied:
4443
description:
4544
de: Minijob § 8 (1) Nr. 1 SGB IV
4645
en: Minijob § 8 (1) Nr. 1 SGB IV
47-
unit: EUR_PER_MONTH
46+
unit: DM_PER_MONTH
4847
type: dict
4948
1990-01-01:
50-
unit: DM_PER_MONTH
5149
west: 470
5250
ost: 200
5351
1991-01-01:

src/gettsim/germany/sozialversicherung/rente/alter_bei_renteneintritt.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from ttsim.unit_converters import m_to_y
66

7-
from gettsim.tt import TTSIMUnit, cast_unit, policy_function
7+
from gettsim.tt import TTSIMUnit, policy_function
88

99

1010
@policy_function(unit=TTSIMUnit.YEARS)
@@ -22,7 +22,8 @@ def alter_bei_renteneintritt(
2222
month will be considered a month too young. Hence, subtract 1 additional month from
2323
monat_renteneintritt.
2424
"""
25-
return (jahr_renteneintritt - geburtsjahr) + cast_unit(
26-
m_to_y(monat_renteneintritt - geburtsmonat - 1),
27-
TTSIMUnit.YEARS,
25+
return (
26+
jahr_renteneintritt
27+
- geburtsjahr
28+
+ m_to_y(monat_renteneintritt - geburtsmonat - 1)
2829
)

0 commit comments

Comments
 (0)