Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Jul 19, 2021
1 parent c8adbd7 commit 084d35c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openfisca_uk_data/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
FRS,
BaseFRS,
FRS_SPI_Adjusted,
SynthFRS
SynthFRS,
)
from openfisca_uk_data.datasets.spi import RawSPI, BaseSPI, SPI
2 changes: 1 addition & 1 deletion openfisca_uk_data/datasets/frs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from openfisca_uk_data.datasets.frs.base_frs import BaseFRS
from openfisca_uk_data.datasets.frs.frs import FRS
from openfisca_uk_data.datasets.frs.frs_spi_adjusted import FRS_SPI_Adjusted
from openfisca_uk_data.datasets.frs.synth_frs import SynthFRS
from openfisca_uk_data.datasets.frs.synth_frs import SynthFRS
8 changes: 5 additions & 3 deletions openfisca_uk_data/datasets/frs/synth_frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import h5py


@dataset
class SynthFRS:
name = "synth_frs"
Expand Down Expand Up @@ -47,7 +48,9 @@ def anonymise(df: pd.DataFrame) -> pd.DataFrame:
for variable in data.keys():
if system.variables[variable].entity.key == entity:
entity_dfs[entity][variable] = data[variable][str(year)]
person, benunit, household = map(lambda x: anonymise(pd.DataFrame(x)), entity_dfs.values())
person, benunit, household = map(
lambda x: anonymise(pd.DataFrame(x)), entity_dfs.values()
)

year = int(year)

Expand All @@ -61,6 +64,5 @@ def anonymise(df: pd.DataFrame) -> pd.DataFrame:
for variable in household.columns:
f[f"{variable}/{year}"] = household[variable].values


def save(data_file, year: int = 2018):
shutil.copyfile(data_file, SynthFRS.data_dir / SynthFRS.filename(year))
shutil.copyfile(data_file, SynthFRS.data_dir / SynthFRS.filename(year))

0 comments on commit 084d35c

Please sign in to comment.