architecture-building-systems / CityEnergyAnalyst

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

street helper error #3125

Closed Raummma97 closed 1 year ago

Raummma97 commented 2 years ago

Hi please I need a help .. when I try to create new project I can't open it from open street map there is unknown error occurs ..it work only when I make two scenarios in the same project the first one to import files I made it in QGIS and another one open it with open street map ..but it work with error in street helper the error is : street error.docx

City Energy Analyst version 3.24.0
Running `cea streets-helper` with the following parameters:
- general:scenario = C:\idk\idk
  (default: {general:project}\{general:scenario-name})
- streets-helper:bbox = []
  (default: [])
- streets-helper:streets = all_private
  (default: all_private)
generating streets from Surroundings Geometry
Traceback (most recent call last):
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexes\base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 146, in worker
    run_job(config, job, server)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 108, in run_job
    script(config=config, **parameters)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 59, in __call__
    self._runner.__call__(*args, **kwargs)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 37, in script_runner
    script_module.main(config)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\datamanagement\streets_helper.py", line 97, in main
    geometry_extractor_osm(locator, config)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\datamanagement\streets_helper.py", line 81, in geometry_extractor_osm
    data.loc[:, "name"] = [x[0] if type(x) == list else x for x in data["name"].values]
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\geopandas\geodataframe.py", line 828, in __getitem__
    result = super(GeoDataFrame, self).__getitem__(key)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexes\base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'name'

the shape file of street is : streets (2).zip

shanshanhsieh commented 2 years ago

Hi @Raummma97 ,

Could you please provide more information? What are the differences between the two scenarios? which one was working and which one not? What files did you import from QGIS?

Thanks

Raummma97 commented 2 years ago

hi the scenario I opened from open street map in the CEA is working the scenario with imported files is not work but both of them I open in the same project because when I open only from cea it say there is unknown error and if I opened only scenario of imported files it isn't working correctly

I import zone, surrounding ,terrain and street shape files

Raummma97 commented 2 years ago

this what I mean open with CEA open street map and unknown error:

city-energy-analyst-gui 2022-04-03 09-46-03.zip

Raummma97 commented 2 years ago

@shanshanhsieh

street helper error : city-energy-analyst-gui 2022-04-03 10-10-33.zip

street error.docx

City Energy Analyst version 3.24.0
Running `cea streets-helper` with the following parameters:
- general:scenario = C:\idk\idk
  (default: {general:project}\{general:scenario-name})
- streets-helper:bbox = []
  (default: [])
- streets-helper:streets = all_private
  (default: all_private)
generating streets from Surroundings Geometry
Traceback (most recent call last):
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexes\base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 146, in worker
    run_job(config, job, server)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 108, in run_job
    script(config=config, **parameters)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 59, in __call__
    self._runner.__call__(*args, **kwargs)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 37, in script_runner
    script_module.main(config)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\datamanagement\streets_helper.py", line 97, in main
    geometry_extractor_osm(locator, config)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\datamanagement\streets_helper.py", line 81, in geometry_extractor_osm
    data.loc[:, "name"] = [x[0] if type(x) == list else x for x in data["name"].values]
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\geopandas\geodataframe.py", line 828, in __getitem__
    result = super(GeoDataFrame, self).__getitem__(key)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexes\base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'name'
Raummma97 commented 2 years ago

when I open an imported files scenario it opens with errors and it is not work : city-energy-analyst-gui 2022-04-03 10-31-47.zip

the errors of imported files street error and radiation error : radation error.docx

City Energy Analyst version 3.24.0
Running `cea radiation` with the following parameters:
- general:scenario = C:\z\z
  (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)
- radiation:buildings = ['L libraries', 'alkhawarizmi collage', 'new dean', 'workshop']
  (default: [])
- radiation:use-latest-daysim-binaries = True
  (default: True)
- radiation:albedo = 0.2
  (default: 0.2)
- radiation:roof-grid = 10
  (default: 10)
- radiation:walls-grid = 200
  (default: 200)
- radiation:zone-geometry = 2
  (default: 2)
- radiation:surrounding-geometry = 5
  (default: 5)
- radiation:consider-floors = True
  (default: True)
- radiation:consider-intersections = False
  (default: False)
- radiation:rad-ab = 4
  (default: 4)
- radiation:rad-ad = 512
  (default: 512)
- radiation:rad-as = 32
  (default: 32)
- radiation:rad-ar = 20
  (default: 20)
- radiation:rad-aa = 0.15
  (default: 0.15)
- radiation:rad-lr = 8
  (default: 8)
- radiation:rad-st = 0.5
  (default: 0.5)
- radiation:rad-sj = 0.7
  (default: 0.7)
- radiation:rad-lw = 0.05
  (default: 0.05)
- radiation:rad-dj = 0.7
  (default: 0.7)
- radiation:rad-ds = 0.0
  (default: 0.0)
- radiation:rad-dr = 0
  (default: 0)
- radiation:rad-dp = 32
  (default: 32)
- radiation:daysim-bin-directory = C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Daysim
  (default: C:\Users\HP\Documents\CityEnergyAnalyst)
- radiation:n-buildings-in-chunk = 100
  (default: 100)
- radiation:write-sensor-data = True
  (default: True)
Using Daysim binaries from path: c:\users\hp\documents\cityenergyanalyst\dependencies\daysim\bin64
Using Daysim data from path: c:\users\hp\documents\cityenergyanalyst\dependencies\daysim\lib
verifying geometry files
zone: C:\z\z\inputs\building-geometry\zone.shp
surroundings: C:\z\z\inputs\building-geometry\surroundings.shp
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
Getting geometry materials
Creating 3D geometry and surfaces
Saving geometry pickle files in: C:\Users\HP\AppData\Local\Temp\z_radiation_geometry_pickle
Standardizing coordinate systems
Reading terrain geometry
Creating 3D building surfaces
Calculating terrain intersection of building geometries
Using 7 CPU's
Calculation of terrain intersection for building 1 completed out of 4
Calculation of terrain intersection for building 2 completed out of 4
Calculation of terrain intersection for building 3 completed out of 4
Calculation of terrain intersection for building 4 completed out of 4
Using 7 CPU's
Calculation of terrain intersection for building 1 completed out of 3
Calculation of terrain intersection for building 2 completed out of 3
Calculation of terrain intersection for building 3 completed out of 3
Generating geometry for surrounding buildings
Generating geometry for buildings in the zone of analysis
Using 7 CPU's
Generating geometry for building 1 completed out of 4
Generating geometry for building 2 completed out of 4
Generating geometry for building 3 completed out of 4
Generating geometry for building 4 completed out of 4
Creating radiance material file
Creating radiance geometry file
Converting files for DAYSIM
Transforming weather files to daysim format
Running command `epw2wea "C:\z\z\inputs\weather\weather.epw" "C:\Users\HP\AppData\Local\Temp\cea_radiation\common_inputs\weather_60min.wea"`
Transforming radiance files to daysim format
Running command `radfiles2daysim "C:\Users\HP\AppData\Local\Temp\cea_radiation\common_inputs\rad2daysim.hea" -g -m -d`
Creating daysim project in: C:\Users\HP\AppData\Local\Temp\cea_radiation\projects\chunk_0\
Calculating and sending sensor points
Traceback (most recent call last):
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 146, in worker
    run_job(config, job, server)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 108, in run_job
    script(config=config, **parameters)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 59, in __call__
    self._runner.__call__(*args, **kwargs)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 37, in script_runner
    script_module.main(config)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\resources\radiation_daysim\radiation_main.py", line 255, in main
    num_processes=config.get_number_of_processes())
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\resources\radiation_daysim\radiation_main.py", line 84, in radiation_singleprocessing
    max_global, weatherfile, geometry_pickle_dir)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\resources\radiation_daysim\daysim_main.py", line 188, in isolation_daysim
    daysim_project.execute_ds_illum()
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\resources\radiation_daysim\radiance.py", line 326, in execute_ds_illum
    CEADaySim.run_cmd(command1)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\resources\radiation_daysim\radiance.py", line 82, in run_cmd
    subprocess.check_call(cmd, cwd=cwd, stderr=subprocess.STDOUT, env=os.environ)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ds_illum "C:\Users\HP\AppData\Local\Temp\cea_radiation\projects\chunk_0\chunk_0.hea"' returned non-zero exit status 1.

Starting Daysim simulation for buildings: ['L libraries', 'alkhawarizmi collage', 'new dean', 'workshop']
Total number of sensors:  581
Writing radiance parameters
Executing hourly solar isolation calculation
Running command `gen_dc "C:\Users\HP\AppData\Local\Temp\cea_radiation\projects\chunk_0\chunk_0.hea" -dir`
Running command `gen_dc "C:\Users\HP\AppData\Local\Temp\cea_radiation\projects\chunk_0\chunk_0.hea" -dif`
Running command `gen_dc "C:\Users\HP\AppData\Local\Temp\cea_radiation\projects\chunk_0\chunk_0.hea" -paste`
Running command `ds_illum "C:\Users\HP\AppData\Local\Temp\cea_radiation\projects\chunk_0\chunk_0.hea"`

city-energy-analyst-gui 2022-04-03 10-33-43.zip

Raummma97 commented 2 years ago

this video shows I opened two scenario in the same project the first one from open street map and it work until I create another scenario with imported files after that the first one working with street error only

city-energy-analyst-gui 2022-04-03 10-45-39.zip

Raummma97 commented 2 years ago

@shanshanhsieh

Raummma97 commented 2 years ago

@daren-thomas

reyery commented 2 years ago

Hi @Raummma97, after looking through the errors, I found out that there is a bug in the CEA script street-helpers looking for the name property which does not exist. I can help fix that. However, I am unable to reproduce the error for the radiation script, so I am not too sure how to help you with that.

@shanshanhsieh Do we need the name property for streets? Based on what it is, it just shows the name of the road/street which might not exist/available for some places in OSM. I think CEA does not necessary need to store this for streets.

shanshanhsieh commented 2 years ago

hi @reyery , thanks for spotting the error! as far as I know, the name property is not necessary for any other scripts, please go ahead and fix it. thanks!

Raummma97 commented 2 years ago

@reyery @shanshanhsieh thank you very much >> please I have another problem .. when I run network layout ..can you help me

layout error.docx

City Energy Analyst version 3.24.0
Running `cea network-layout` with the following parameters:
- general:scenario = C:\abodhabi\abodhabi
  (default: {general:project}\{general:scenario-name})
- network-layout:network-type = DC
  (default: DC)
- network-layout:connected-buildings = ['WTC']
  (default: [])
- network-layout:pipe-diameter = 150
  (default: 150)
- network-layout:type-mat = T1
  (default: T1)
- network-layout:allow-looped-networks = False
  (default: False)
- network-layout:consider-only-buildings-with-demand = False
  (default: True)
Traceback (most recent call last):
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexes\base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'FID'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 146, in worker
    run_job(config, job, server)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\worker.py", line 108, in run_job
    script(config=config, **parameters)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 59, in __call__
    self._runner.__call__(*args, **kwargs)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\api.py", line 37, in script_runner
    script_module.main(config)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\technologies\network_layout\main.py", line 104, in main
    layout_network(network_layout, locator)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\technologies\network_layout\main.py", line 76, in layout_network
    disconnected_building_names)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\cea\technologies\network_layout\steiner_spanning_tree.py", line 119, in calc_steiner_spanning_tree
    mst_nodes['Name'] = mst_nodes['FID'].apply(lambda x: "NODE" + str(x))
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\geopandas\geodataframe.py", line 828, in __getitem__
    result = super(GeoDataFrame, self).__getitem__(key)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexes\base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'FID'
Raummma97 commented 2 years ago

@daren-thomas

shanshanhsieh commented 2 years ago

Hi @Raummma97 ,

It seems like the street properties presented in your case study site are quite different from the streets in other sites we have tested. We are working on addressing this now. On your side, I will recommend you first try out the same functionality in the context where we have done more testing (e.g., Singapore). This way, we could isolate the problem from the code.

Good luck!

Raummma97 commented 2 years ago

hi @shanshanhsieh

I try (Zug and Singapore) the same error occurred Screenshot 2022-04-21 212800 network layout error.docx

Raummma97 commented 2 years ago

@ @shanshanhsieh @reyery @ @daren-thomas @nheeren please help me to solve the error ??

shanshanhsieh commented 2 years ago

Hi @Raummma97 , I recommend you to completely uninstall your current CEA (by clicking the icon Uninstall_CityEnergyAnalyst_3.29.0.exe and make sure the entire CityEnergyAnalyst folder is empty), and install v3.31.0. In the new version, we introduced better error reporting functions, which could help us understand the errors you are facing better.

Raummma97 commented 2 years ago

Hi @shanshanhsieh .. ok I will do it and try .. thank you

Raummma97 commented 2 years ago

Hi @shanshanhsieh the same error of network-layout occur City Energy Analyst version 3.31.0 Running cea network-layout with the following parameters:

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "c:\users\hp\documents\cityenergyanalyst\cityenergyanalyst\cea\worker.py", line 146, in worker run_job(config, job, server) File "c:\users\hp\documents\cityenergyanalyst\cityenergyanalyst\cea\worker.py", line 108, in run_job script(config=config, *parameters) File "c:\users\hp\documents\cityenergyanalyst\cityenergyanalyst\cea\api.py", line 60, in call self._runner.call(args, **kwargs) File "c:\users\hp\documents\cityenergyanalyst\cityenergyanalyst\cea\api.py", line 38, in script_runner script_module.main(config) File "c:\users\hp\documents\cityenergyanalyst\cityenergyanalyst\cea\technologies\network_layout\main.py", line 107, in main layout_network(network_layout, locator, plant_building_names=plant_building_names) File "c:\users\hp\documents\cityenergyanalyst\cityenergyanalyst\cea\technologies\network_layout\main.py", line 63, in layout_network calc_steiner_spanning_tree(crs_projected, File "c:\users\hp\documents\cityenergyanalyst\cityenergyanalyst\cea\technologies\network_layout\steiner_spanning_tree.py", line 119, in calc_steiner_spanning_tree mst_nodes['Name'] = mst_nodes['FID'].apply(lambda x: "NODE" + str(x)) File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\geopandas\geodataframe.py", line 1327, in getitem result = super().getitem(key) File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\frame.py", line 3505, in getitem indexer = self.columns.get_loc(key) File "C:\Users\HP\Documents\CityEnergyAnalyst\Dependencies\Python\lib\site-packages\pandas\core\indexes\base.py", line 3623, in get_loc raise KeyError(key) from err KeyError: 'FID'

Raummma97 commented 2 years ago

@shanshanhsieh