architecture-building-systems / CityEnergyAnalyst

The City Energy Analyst (CEA)
https://www.cityenergyanalyst.com/
MIT License
192 stars 61 forks source link

schedules maker does not work. zone label is not in the index #2816

Closed RicardoGomesIST closed 7 months ago

RicardoGomesIST commented 4 years ago

Hi, when I run the building demand/Building schedules from the CEA dashboard it does not run and says that the first zone label is not in the index.

I have around 1800 buildings. I created the schedules from the Archetype Mapper and they appear on the \inputs\building-properties\schedules and look good.

here is the info I get:

City Energy Analyst version 3.7.0
Running `cea schedule-maker` with the following parameters:
- general:scenario = C:\Users\Aluno\Desktop\encarnacao\baseline2\baseline2
  (default: {general:project}\{general:scenario-name})
- general:multiprocessing = True
  (default: True)
- general:number-of-cpus-to-keep-free = 1
  (default: 1)
- general:debug = False
  (default: False)
- schedule-maker:buildings = ['B54852']
  (default: ['B54850', 'B54852', ' ................------....., 'B61222', 'B61223', 'B61224', 'B61225', 'B61226', 'B61227', 'B61231', 'B61232', 'B61234', 'B61235', 'B62605', 'B62606', 'B62608', 'B62609', 'B62610', 'B62611'])
- schedule-maker:schedule-model = deterministic
  (default: deterministic)
Running occupancy model for scenario C:\Users\Aluno\Desktop\encarnacao\baseline2\baseline2
Running occupancy model  with schedule model=deterministic
Traceback (most recent call last):
  File "c:\users\aluno\documents\cityenergyanalyst\cityenergyanalyst\cea\worker.py", line 146, in worker
    run_job(config, job, server)
  File "c:\users\aluno\documents\cityenergyanalyst\cityenergyanalyst\cea\worker.py", line 108, in run_job
    script(config=config, **parameters)
  File "c:\users\aluno\documents\cityenergyanalyst\cityenergyanalyst\cea\api.py", line 58, in __call__
    self._runner.__call__(*args, **kwargs)
  File "c:\users\aluno\documents\cityenergyanalyst\cityenergyanalyst\cea\api.py", line 38, in script_runner
    script_module.main(config)
  File "c:\users\aluno\documents\cityenergyanalyst\cityenergyanalyst\cea\demand\schedule_maker\schedule_maker.py", line 476, in main
    schedule_maker_main(locator, config)
  File "c:\users\aluno\documents\cityenergyanalyst\cityenergyanalyst\cea\demand\schedule_maker\schedule_maker.py", line 84, in schedule_maker_main
    [prop_geometry.loc[b] for b in buildings],
  File "C:\Users\Aluno\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexing.py", line 1478, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "C:\Users\Aluno\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexing.py", line 1911, in _getitem_axis
    self._validate_key(key, axis)
  File "C:\Users\Aluno\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexing.py", line 1798, in _validate_key
    error()
  File "C:\Users\Aluno\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexing.py", line 1785, in error
    axis=self.obj._get_axis_name(axis)))
KeyError: u'the label [B54852] is not in the [index]'

`..

I Work with City Energy Analyst version 3.7.0, on windows 10 thank you very much

RicardoGomesIST commented 4 years ago

I created a new archetype database by copying the CH and changed the name and added some solutions. Everything seems good when using the Archetype Mapper. But for the schedules doesn't run well. After hours I understood that the standard name was too long (at least it worked with smaller ones). Now it runs. So, I will just leave this post for you to confirm this possibility or is other thing that I didn't notice.

thank you!

reyery commented 7 months ago

I can confirm that sometimes pandas would guess and encode the names of buildings incorrectly (e.g. as floats instead of string, etc). One way we solve this is to explicitly tell pandas to always read the "Name" column as string.

Closing this issue as it has been resolved.