Skip to content

Commit b3e19cf

Browse files
MImmesbergerhmgaudeckerpre-commit-ci[bot]
authored
Namespaces: Turn tests back on (#841)
This PR is based on #805 and turns the tests back on which were previously skipped. Todos: - [x] Turn all tests on - [x] Rename test dirs --------- Co-authored-by: Hans-Martin von Gaudecker <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7876096 commit b3e19cf

File tree

2,251 files changed

+83043
-82877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,251 files changed

+83043
-82877
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ docs/_build
7272
docs/tutorials/sandbox_cz.ipynb
7373
_version.py
7474
.pixi/
75+
prof/

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
# If extensions (or modules to document with autodoc) are in another directory, add
66
# these directories to sys.path here. If the directory is relative to the documentation
77
# root, use os.path.abspath to make it absolute, like shown here.
8-
import datetime as dt
98
import pathlib
109
import sys
10+
from datetime import datetime
1111

1212
sys.path.insert(0, str(pathlib.Path("../src").resolve()))
1313

1414
# -- Project information -----------------------------------------------------
1515

1616
project = "GETTSIM"
17-
copyright = f"2019-{dt.datetime.today().year}, GETTSIM team" # noqa: A001
17+
copyright = f"2019-{datetime.today().year}, GETTSIM team" # noqa: A001
1818
author = "GETTSIM team"
1919
release = "0.7.0"
2020
version = ".".join(release.split(".")[:2])

docs/geps/gep-01.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ indicate the level of aggregation.
126126

127127
GETTSIM knows about the following units:
128128

129-
- `demographics__p_id`: person identifier
130-
- `demographics__hh_id`: Haushalt, individuals living together in a household in the
131-
Wohngeld sense (§5 WoGG).
129+
- `p_id`: person identifier
130+
- `hh_id`: Haushalt, individuals living together in a household in the Wohngeld sense
131+
(§5 WoGG).
132132
- `wohngeld__wthh_id`: Wohngeldrechtlicher Teilhaushalt, i.e. members of a household for
133133
whom the priority check for Wohngeld/ALG2 yields the same result ∈ {True, False}. This
134134
unit is based on the priority check via
@@ -144,8 +144,7 @@ GETTSIM knows about the following units:
144144
- `arbeitslosengeld_2__eg_id`: Einstandsgemeinschaft, a couple whose members are deemed
145145
to be responsible for each other. This includes couples that live together and may or
146146
may not be married or in a civil union.
147-
- `demographics__ehe_id`: Ehegemeinschaft, i.e. couples that are married or in a civil
148-
union.
147+
- `familie__ehe_id`: Ehegemeinschaft, i.e. couples that are married or in a civil union.
149148
- `einkommensteuer__sn_id`: Steuernummer (same for spouses filing taxes jointly, not the
150149
same as the Germany-wide Steuer-ID)
151150

docs/geps/gep-04.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ is able to replace this function with her own version.
8282
See the following example for capital income taxes (Abgeltungssteuer).
8383

8484
```python
85-
def abgeltungssteuer__betrag_y_sn(
85+
def einkommensteuer__abgeltungssteuer__betrag_y_sn(
8686
einkommensteuer__einkünfte__aus_kapitalvermögen__betrag_y_sn: float,
8787
abgelt_st_params: dict,
8888
) -> float:
@@ -105,7 +105,7 @@ def abgeltungssteuer__betrag_y_sn(
105105
)
106106
```
107107

108-
The function `abgeltungssteuer__betrag_y_sn` requires the variable
108+
The function `einkommensteuer__abgeltungssteuer__betrag_y_sn` requires the variable
109109
`einkommensteuer__einkünfte__aus_kapitalvermögen__betrag_y_sn`, which is the amount of
110110
taxable capital income on the Steuernummer-level (the latter is implied by the `_sn`
111111
suffix, see {ref}`gep-1`).
@@ -114,23 +114,24 @@ user as a column of the input data or it has to be the name of another function.
114114
`abgelt_st_params` is a dictionary of parameters related to the calculation of
115115
`betrag_y_sn`.
116116

117-
> Note: In the source code, the prefix `abgeltungssteuer__` is missing. This is because
118-
> it is inferred from the path the function is defined in. For more details, see
119-
> {ref}`gep-6`.
117+
> Note: In the source code, the prefix `einkommensteuer__abgeltungssteuer__` is missing.
118+
> This is because it is inferred from the path the function is defined in. For more
119+
> details, see {ref}`gep-6`.
120120
121121
Another function, say
122122

123123
```python
124124
def solidaritätszuschlag__betrag_y_sn(
125125
einkommensteuer__betrag_mit_kinderfreibetrag_y_sn: float,
126126
einkommensteuer__anzahl_personen_sn: int,
127-
abgeltungssteuer__betrag_y_sn: float,
127+
einkommensteuer__abgeltungssteuer__betrag_y_sn: float,
128128
soli_st_params: dict,
129129
) -> float: ...
130130
```
131131

132-
may use `abgeltungssteuer__betrag_y_sn` as an input argument. The DAG backend ensures
133-
that the function `abgeltungssteuer__betrag_y_sn` will be executed first.
132+
may use `einkommensteuer__abgeltungssteuer__betrag_y_sn` as an input argument. The DAG
133+
backend ensures that the function `einkommensteuer__abgeltungssteuer__betrag_y_sn` will
134+
be executed first.
134135

135136
Note that the type annotations (e.g. `float`) indicate the expected type of each input
136137
and the output of a function, see {ref}`gep-2`.
@@ -231,22 +232,22 @@ In order to inject aggregation functions at the group level into the graph, scri
231232
functions of the taxes and transfer system should define a dictionary
232233
`aggregation_specs` at the module level. This dictionary must specify the aggregated
233234
columns as keys and the AggregateByGroupSpec data class as values. The data class
234-
specifies the `source_col` (i.e. the column which is being aggregated) and the
235-
aggregation method `aggr`.
235+
specifies the `source` (i.e. the column which is being aggregated) and the aggregation
236+
method `aggr`.
236237

237-
For example, in `demographics.py`, we could have:
238+
For example, in `household_characteristics.py`, we could have:
238239

239240
```
240241
from _gettsim.aggregation import AggregateByGroupSpec
241242
242243
aggregation_specs = {
243-
"anzahl_kinder_hh": AggregateByGroupSpec(source_col="demographics__kind", aggr="sum"),
244+
"anzahl_kinder_hh": AggregateByGroupSpec(source="familie__kind", aggr="sum"),
244245
"anzahl_personen_hh": AggregateByGroupSpec(aggr="count"),
245246
}
246247
```
247248

248249
The group identifier (`hh_id`, `wohngeld__wthh_id`, `arbeitslosengeld_2__fg_id`,
249-
`arbeitslosengeld_2__bg_id`, `arbeitslosengeld_2__eg_id`, `demographics__ehe_id`,
250+
`arbeitslosengeld_2__bg_id`, `arbeitslosengeld_2__eg_id`, `familie__ehe_id`,
250251
`einkommensteuer__sn_id`) will be automatically included as an argument; for `count`
251252
nothing else is necessary.
252253

@@ -291,7 +292,7 @@ from _gettsim.aggregation import AggregateByGroupSpec
291292
292293
aggregation_specs = {
293294
"kindergeld__betrag_m_bg": AggregateByGroupSpec(
294-
source_col="kindergeld__betrag_m",
295+
source="kindergeld__betrag_m",
295296
aggr="sum"
296297
)
297298
}
@@ -311,21 +312,20 @@ The implementation is similar to aggregations to the level of groupings: In orde
311312
specify new aggregation functions, scripts with functions of the taxes and transfer
312313
system should define a dictionary `aggregation_specs` at the module level. This
313314
dictionary must specify the aggregated columns as keys and the `AggregateByPIDSpec` data
314-
class as values. The class specifies the `source_col`, `p_id_to_aggregate_by`, and
315-
`aggr`. If `aggr` is `count`, `source_col` is not needed.
315+
class as values. The class specifies the `source`, `p_id_to_aggregate_by`, and `aggr`.
316+
If `aggr` is `count`, `source` is not needed.
316317

317-
The key `source_col` specifies which column is the source of the aggregation operation.
318-
The key `p_id_to_aggregate_by` specifies the column that indicates to which `p_id` the
319-
values in `source_col` should be ascribed to. The key `aggr` gives the aggregation
320-
method.
318+
The key `source` specifies which column is the source of the aggregation operation. The
319+
key `p_id_to_aggregate_by` specifies the column that indicates to which `p_id` the
320+
values in `source` should be ascribed to. The key `aggr` gives the aggregation method.
321321

322322
For example, in `kindergeld.py`, we could have:
323323

324324
```
325325
aggregation_specs = {
326326
"kindergeld__anzahl_ansprüche": AggregateByPIDSpec(
327327
p_id_to_aggregate_by="kindergeld__p_id_empfänger",
328-
source_col="kindergeld__grundsätzlich_anspruchsberechtigt",
328+
source="kindergeld__grundsätzlich_anspruchsberechtigt",
329329
aggr="sum",
330330
),
331331
}

docs/geps/gep-05.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ argument of `policy_function` has to be `"ges_rente"`:
8383
```python
8484
@policy_function(params_key_for_rounding="ges_rente")
8585
def sozialversicherung__rente__grundrente__höchstbetrag_m(
86-
sozialversicherung__rente__grundrente__grundrentenzeiten_m: int,
86+
sozialversicherung__rente__grundrente__grundrentenzeiten_monate: int,
8787
) -> float:
8888
...
8989
return out

docs/gettsim_developer/hh_concepts.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ The units are:
1616

1717
| Unit | ID | Description | Endogenous |
1818
| -------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
19-
| Haushalt | demographics\_\_hh_id | Individuals that live together in one household in the Wohngeld sense (§5 WoGG). | no |
19+
| Haushalt | hh_id | Individuals that live together in one household in the Wohngeld sense (§5 WoGG). | no |
2020
| wohngeldrechtlicher Teilhaushalt | wohngeld\_\_wthh_id | The relevant unit for Wohngeld. Encompasses all members of a household for whom the Vorrangprüfung of Wohngeld against ALG2/Kinderzuschlag has the same result ∈ {True, False}. | yes |
21-
| Familiengemeinschaft | demographics\_\_fg_id | Maximum of two generations, the relevant base unit for Bürgergeld / Arbeitslosengeld 2, before excluding children who have enough income fend for themselves. | yes |
21+
| Familiengemeinschaft | familie\_\_fg_id | Maximum of two generations, the relevant base unit for Bürgergeld / Arbeitslosengeld 2, before excluding children who have enough income fend for themselves. | yes |
2222
| Bedarfsgemeinschaft | arbeitslosengeld_2\_\_bg_id | Familiengemeinschaft except for children who have enough income to fend for themselves. Relevant unit for Bürgergeld / Arbeitslosengeld 2. | yes |
2323
| Steuernummer | einkommensteuer\_\_sn_id | Spouses filing taxes jointly or individuals. | yes |
24-
| Ehepartner | demographics\_\_ehe_id | Couples that are either married or in a civil union. | yes |
24+
| Ehepartner | familie\_\_ehe_id | Couples that are either married or in a civil union. | yes |
2525
| Einstandsgemeinschaft | arbeitslosengeld_2\_\_eg_id | A couple whose members are deemed to be responsible for each other. | yes |
2626

2727
## Taxes
@@ -38,7 +38,7 @@ The units are:
3838

3939
#### Pointers
4040

41-
- `demographics__p_id_ehepartner`
41+
- `familie__p_id_ehepartner`
4242

4343
### Kinderfreibeträge
4444

@@ -52,10 +52,10 @@ The units are:
5252

5353
#### Pointers
5454

55-
- `einkommensteuer__p_id_kinderfreibetragempfänger_1` and
56-
`einkommensteuer__p_id_kinderfreibetragempfänger_2` (either set by the user or
57-
calculated endogenously via `demographics__p_id_elternteil_1` and
58-
`demographics__p_id_elternteil_2`)
55+
- `einkommensteuer__p_id_kinderfreibetragsempfänger_1` and
56+
`einkommensteuer__p_id_kinderfreibetragsempfänger_2` (either set by the user or
57+
calculated endogenously via `familie__p_id_elternteil_1` and
58+
`familie__p_id_elternteil_2`)
5959

6060
## Kindergeld
6161

@@ -82,8 +82,8 @@ The units are:
8282

8383
#### Pointers
8484

85-
- `arbeitslosengeld_2__p_id_einstandspartner`, `demographics__p_id_elternteil_1`,
86-
`demographics__p_id_elternteil_2` (exogenous)
85+
- `arbeitslosengeld_2__p_id_einstandspartner`, `familie__p_id_elternteil_1`,
86+
`familie__p_id_elternteil_2` (exogenous)
8787

8888
## Elterngeld
8989

@@ -95,14 +95,14 @@ The units are:
9595

9696
#### Pointers
9797

98-
- `demographics__p_id_elternteil_1`, `demographics__p_id_elternteil_2` (exogenous)
98+
- `familie__p_id_elternteil_1`, `familie__p_id_elternteil_2` (exogenous)
9999

100100
## Unterhalt / Unterhaltsvorschuss
101101

102102
#### Description
103103

104104
- Parents and their children
105-
- Parents necessarily in different households (different `demographics__hh_id`)
105+
- Parents necessarily in different households (different `hh_id`)
106106

107107
#### Pointers
108108

@@ -119,7 +119,7 @@ The units are:
119119

120120
#### Pointers
121121

122-
- `demographics__p_id_elternteil_1`, `demographics__p_id_elternteil_2` (exogenous)
122+
- `familie__p_id_elternteil_1`, `familie__p_id_elternteil_2` (exogenous)
123123

124124
## Rente
125125

@@ -131,11 +131,11 @@ The units are:
131131

132132
#### Aggregation unit
133133

134-
- `demographics__ehe_id` (endogenous)
134+
- `familie__ehe_id` (endogenous)
135135

136136
#### Pointers
137137

138-
- `demographics__p_id_ehepartner` (exogenous)
138+
- `familie__p_id_ehepartner` (exogenous)
139139

140140
### Verwitwetenrente
141141

@@ -146,11 +146,11 @@ The units are:
146146

147147
#### Aggregation unit
148148

149-
- `demographics__ehe_id` (endogenous)
149+
- `familie__ehe_id` (endogenous)
150150

151151
#### Pointers
152152

153-
- `demographics__p_id_ehepartner` (exogenous)
153+
- `familie__p_id_ehepartner` (exogenous)
154154

155155
## Bürgergeld und Sozialhilfe
156156

@@ -174,8 +174,8 @@ The units are:
174174

175175
#### Pointers
176176

177-
- `arbeitslosengeld_2__p_id_einstandspartner`, `demographics__p_id_elternteil_1`,
178-
`demographics__p_id_elternteil_2` (exogenous)
177+
- `arbeitslosengeld_2__p_id_einstandspartner`, `familie__p_id_elternteil_1`,
178+
`familie__p_id_elternteil_2` (exogenous)
179179

180180
### SGB XII (Hilfe zum Lebensunterhalt)
181181

@@ -211,8 +211,8 @@ Regarding the household definition:
211211

212212
#### Pointers
213213

214-
- `demographics__hh_id`, `arbeitslosengeld_2__p_id_einstandspartner`,
215-
`demographics__p_id_elternteil_1`, `demographics__p_id_elternteil_2` (exogenous)
214+
- `hh_id`, `arbeitslosengeld_2__p_id_einstandspartner`, `familie__p_id_elternteil_1`,
215+
`familie__p_id_elternteil_2` (exogenous)
216216

217217
### SGB XII (Grundsicherung im Alter / bei Erwerbsminderung)
218218

@@ -237,8 +237,8 @@ Government expenditures: 7 Mrd €
237237

238238
#### Pointers
239239

240-
- `arbeitslosengeld_2__p_id_einstandspartner`, `demographics__p_id_elternteil_1`,
241-
`demographics__p_id_elternteil_2` (exogenous)
240+
- `arbeitslosengeld_2__p_id_einstandspartner`, `familie__p_id_elternteil_1`,
241+
`familie__p_id_elternteil_2` (exogenous)
242242

243243
### SGB XII (Eingliederungshilfe für Menschen mit Behinderung)
244244

@@ -291,7 +291,7 @@ Government expenditures: 4 Mrd €
291291
Bedarfsgemeinschaft gets Wohngeld and which gets SGB II.
292292
- If no or all household members receive Bürgergeld instead of an SGB II transfer, the
293293
wohngeldrechtlicher Teilhaushalt equals the Haushalt, i.e.
294-
`wohngeld__wthh_id = demographics__hh_id`.
294+
`wohngeld__wthh_id = hh_id`.
295295
- Households that consist of at least one Bedarfsgemeinschaft and one
296296
wohngeldrechtlicher Teilhaushalt are called "Mischhaushalte".
297297

@@ -301,8 +301,8 @@ Government expenditures: 4 Mrd €
301301

302302
#### Pointers
303303

304-
- `demographics__hh_id`, `arbeitslosengeld_2__p_id_einstandspartner`,
305-
`demographics__p_id_elternteil_1`, `demographics__p_id_elternteil_2` (exogenous)
304+
- `hh_id`, `arbeitslosengeld_2__p_id_einstandspartner`, `familie__p_id_elternteil_1`,
305+
`familie__p_id_elternteil_2` (exogenous)
306306

307307
### Kinderwohngeld
308308

0 commit comments

Comments
 (0)