architecture-building-systems / CityEnergyAnalyst

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

archtypes-mapper IndexError: #3625

Open AhmedSerageldin opened 1 month ago

AhmedSerageldin commented 1 month ago

I exported zone.shp file from QGIS Then I successfully read in CEA, after that when I run the arctypes-mapper i got the following IndexError :"IndexError: single positional indexer is out-of-bounds". What could be the reason and how to solve it? Thanks in advance

- archetypes-mapper:input-databases = ['architecture']
  (default: ['comfort', 'architecture', 'air-conditioning', 'internal-loads', 'supply', 'schedules'])
Traceback (most recent call last):
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\worker.py", line 146, in worker
    run_job(config, job, server)
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\worker.py", line 108, in run_job
    script(config=config, **parameters)
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\api.py", line 60, in __call__
    self._runner.__call__(*args, **kwargs)
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\api.py", line 38, in script_runner
    script_module.main(config)
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\datamanagement\archetypes_mapper.py", line 409, in main
    archetypes_mapper(locator=locator,
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\datamanagement\archetypes_mapper.py", line 84, in archetypes_mapper
    architecture_mapper(locator, building_typology_df)
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\datamanagement\archetypes_mapper.py", line 201, in architecture_mapper
    dataframe_to_dbf(prop_architecture_df[fields], locator.get_building_architecture())
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\utilities\dbf.py", line 43, in dataframe_to_dbf
    types = [type(df[i].iloc[0]) for i in df.columns]
  File "C:\CityEnergyAnalyst\CityEnergyAnalyst\cea\utilities\dbf.py", line 43, in <listcomp>
    types = [type(df[i].iloc[0]) for i in df.columns]
  File "C:\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\pandas\core\indexing.py", line 1103, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "C:\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\pandas\core\indexing.py", line 1656, in _getitem_axis
    self._validate_integer(key, axis)
  File "C:\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\pandas\core\indexing.py", line 1589, in _validate_integer
    raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds

- archetypes-mapper:buildings = ['B1001', 'B1002', 'B1003', 'B1004']
  (default: [])
c0nb4 commented 1 month ago

Hi Ahmed,

what kind of database are you using? What type of buildings have you selected as type? Are you using CEA in the GUI or within an app?

Take Care

ShiZhongming commented 1 month ago

Hi @AhmedSerageldin Will it be possible to share your zone.shp and typology.dbf with us? cea@arch.ethz.ch