Read Input
Data loading and policy parsing: reads configuration files, building stock data, and policy definitions.
When to use this module
Use project.read_input for:
reading stock, macro, and technical inputs
parsing policy definitions into internal objects
transforming raw tables into model-ready structures
This module also defines policy object abstractions used across the run pipeline.
- class project.read_input.PublicPolicy(name, start, end, value, policy, gest=None, cap=None, target=None, cost_min=None, cost_max=None, new=None, by='index', non_cumulative=None, frequency=None, intensive=None, min_performance=None, bonus=False, social_housing=True, duration=None, recycling=None, proportional=None, recycling_ini=None, year_stop=None, years_stop=None, public_cost=None, variable=True)[source]
Bases:
objectPublic policy parent class.
- name
Name of the policy.
- Type:
str
- start
Year policy starts.
- Type:
int
- end
Year policy ends.
- Type:
int
- value
- Type:
float
- policy
- Type:
{‘energy_taxes’, ‘subsidies’}
- apply_year_stop(year_stop, value)[source]
Put values of an incentive to 1e-4 to assess the impact of removing the incentive.
Rationale is to keep calculating the number of eligible households that renovate without the incentive.
- Parameters:
year_stop –
value –
- cost_targeted(cost_insulation, target_subsidies=None)[source]
Gives the amount of the cost of a gesture for a segment over which the subvention applies.
If self.new, cost global is the amount loaned for gestures which are considered as ‘global renovations’, and thus caped by the proper maximum zil amount taking the heater replacement into account. Also, cost_no_global are the amount loaned for unique or bunch renovations actions.
- Parameters:
cost_insulation (pd.DataFrame) – Cost of an insulation gesture
target_subsidies (pd.DataFrame) – Boolean values. If self.new it corresponds to the global renovations
- Returns:
cost – Each cell of the DataFrame corresponds to the cost after subventions of a specific gesture and segment
- Return type:
pd.DataFrame
- project.read_input.create_simple_policy(start, end, value=0.3, gest='insulation')[source]
- project.read_input.data2dict_inputs(data, metadata)[source]
Parse aggregate data pandas and return dict fill with several inputs.
- Parameters:
data (DataFrame) – Model data input.
metadata (DataFrame) – Additional information to find out how to parse data.
- Return type:
dict
- project.read_input.dict2data_inputs(inputs)[source]
Grouped all inputs in the same DataFrame.
Process is useful to implement a global sensitivity analysis.
- Return type:
DataFrame
- project.read_input.dump_inputs(parsed_inputs, path, figures=None)[source]
Create summary input DataFrame.
- Parameters:
parsed_inputs (dict) –
- Return type:
DataFrame
- project.read_input.parse_inputs(inputs, taxes, config, stock)[source]
Macro module : run exogenous dynamic parameters.
- Parameters:
inputs (dict) – Raw inputs read as Python object.
taxes (list) –
config (dict) – Configuration file.
stock (Series) – Building stock.
- Returns:
Parsed input
- Return type:
dict
- project.read_input.read_inputs(config, other_inputs={'factor_multi_family': 0.87, 'factor_pop_housing': -0.007, 'input_financing': {'factor_saving_rate': pandas.Series, 'share_debt': (0.139, 1.15e-05)}, 'pop_housing_min': 2, 'price_index': 1, 'surface_elasticity': pandas.Series, 'surface_max': pandas.Series})[source]
Read all inputs in Python object and concatenate in one dict.
- Parameters:
config (dict) – Configuration dictionary with path to data.
other_inputs (dict) – Other inputs that are manually inserted in param.py
- Return type:
dict
- project.read_input.read_policies(config)[source]
- project.read_input.read_stock(config)[source]
Read initial building stock.
- Parameters:
config (dict) –
- Returns:
MultiIndex Series with building stock attributes as levels.
- Return type:
pd.Series