Skip to content

zero values not permitted in the "number_of_people_per_household" column #27

@shakythesherpa

Description

@shakythesherpa

When we have a dataset with an override column for "number_of_people_per_household" and some of the values in the column are zeroes then we get the following error:

Running electrificationplanner
Reading input from /home/mr/modelrunner/worker_data/032f9377-3ba3-4444-8ad2-8eee90b39d74/input
~/infrastructure-planning ~/modelrunner
estimate_population
estimate_population_profile
estimate_consumption_from_connection_type
Traceback (most recent call last):
File "estimate_electricity_cost_by_technology_from_population.py", line 300, in
], x.parse_args().dict, FULL_KEYS)
File "/home/mr/infrastructure-planning/infrastructure_planning/macros.py", line 57, in load_and_run
run(main_functions, g)
File "/home/mr/infrastructure-planning/infrastructure_planning/macros.py", line 138, in run
node_d.update(compute(f, l, g))
File "/home/mr/infrastructure-planning/infrastructure_planning/macros.py", line 188, in compute
value_by_key = rename_keys(compute_raw(f, l, g) or {}, prefix=prefix)
File "/home/mr/infrastructure-planning/infrastructure_planning/macros.py", line 205, in compute_raw
return f(**merge_dictionaries(g, l))
File "/home/mr/infrastructure-planning/infrastructure_planning/electricity/consumption/linear.py", line 25, in estimate_consumption_from_connection_type
estimated_household_connection_count_by_year)
File "/home/mr/infrastructure-planning/infrastructure_planning/electricity/consumption/linear.py", line 135, in _get_connection_count_by_year
year_index = estimated_household_connection_count_by_year.index
AttributeError: 'int' object has no attribute 'index'
~/modelrunner

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions