diff --git a/openfisca_uk_data/datasets/__init__.py b/openfisca_uk_data/datasets/__init__.py index 36f1e2f..22372c9 100644 --- a/openfisca_uk_data/datasets/__init__.py +++ b/openfisca_uk_data/datasets/__init__.py @@ -3,6 +3,6 @@ FRS, BaseFRS, FRS_SPI_Adjusted, - SynthFRS + SynthFRS, ) from openfisca_uk_data.datasets.spi import RawSPI, BaseSPI, SPI diff --git a/openfisca_uk_data/datasets/frs/__init__.py b/openfisca_uk_data/datasets/frs/__init__.py index bee9949..5c85890 100644 --- a/openfisca_uk_data/datasets/frs/__init__.py +++ b/openfisca_uk_data/datasets/frs/__init__.py @@ -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 \ No newline at end of file +from openfisca_uk_data.datasets.frs.synth_frs import SynthFRS diff --git a/openfisca_uk_data/datasets/frs/synth_frs.py b/openfisca_uk_data/datasets/frs/synth_frs.py index baa3102..f3e5ee1 100644 --- a/openfisca_uk_data/datasets/frs/synth_frs.py +++ b/openfisca_uk_data/datasets/frs/synth_frs.py @@ -5,6 +5,7 @@ import numpy as np import h5py + @dataset class SynthFRS: name = "synth_frs" @@ -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) @@ -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)) \ No newline at end of file + shutil.copyfile(data_file, SynthFRS.data_dir / SynthFRS.filename(year))