DemandRegioTeam / disaggregator

A set of tools for processing of spatial and temporal disaggregations.
GNU General Public License v3.0
29 stars 16 forks source link

Bug: `temporal.disagg_temporal_power_housholds_slp()` does not work on household basis #17

Open nesnoj opened 1 year ago

nesnoj commented 1 year ago

Executing

temporal.disagg_temporal_power_housholds_slp(by="households")

gives

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/luke/skywalker/disaggregator/disaggregator/temporal.py", line 760, in disagg_temporal_power_housholds_slp
    sv_yearly = ((disagg_households_power(by=by,
  File "/home/luke/skywalker/venv/lib/python3.8/site-packages/pandas/core/generic.py", line 5487, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'to_frame'

This is because disagg_households_power(by="households") returns a DF with household sizes as columns instead of a Series (which is returned for by="population"). If the SLP method is not supported for "households" (but why not?), this should be handled accordingly.

Moreover, the param scale_by_pop shows no effect so scaling is not supported here.