livestock3d / livestock

Livestock is a package for Grasshopper providing components for modelling water movement and hydrothermal effects around buildings to enable and evaluate sustainable solutions, where those effects are incorporated.
GNU General Public License v3.0
9 stars 2 forks source link

AttributeError in livestock #40

Open muc-martin opened 4 years ago

muc-martin commented 4 years ago

I installed livestock and anaconda according to the following tutorial https://kongsgaard.eu/install-livestock.html. However, I cannot get the example files to work as I get the following error.

from livestock.hydrology import run_model File "H:\Anaconda\envs\livestock_env\lib\site-packages\livestock\hydrology.py", line 22, in from livestock import geometry as lg File "H:\Anaconda\envs\livestock_env\lib\site-packages\livestock\geometry.py", line 261, in -> shapefile._Shape: AttributeError: module 'shapefile' has no attribute '_Shape'

muc-martin commented 4 years ago

Could the error be possibly due to pyshp being version 2.x instead 1.x? After downgrading pyshp to 1.2.12 I get following error:

File "H:\Anaconda\envs\livestock_env\lib\site-packages\livestock\hydrology.py", line 606, in run_model project, mesh_info = mesh_to_cells(project, mesh_paths) File "H:\Anaconda\envs\livestock_env\lib\site-packages\livestock\hydrology.py", line 55, in mesh_to_cells polygon.height, polygon.id) File "H:\Anaconda\envs\livestock_env\lib\site-packages\cmf\geometry\geocell.py", line 48, in create_cell c = project.NewCell(*center, area=polygon.area, with_surfacewater=with_surfacewater) RuntimeError: Can't create cell #0. Area<=0.0

ocni-dtu commented 4 years ago

Hi @HerrHansDampf I haven't used Livestock since sometime in 2018. So it is very likely that the dependencies are not working.

muc-martin commented 4 years ago

Hi @ocni-dtu , do you by any chance still have the conda environment you worked with, so I can reproduce it? Attached is my cmf folder as well as the debug info cmf.zip livestock_debug.log

Traceback.log

ocni-dtu commented 4 years ago

@Martin-TUM it says in the traceback that the area of the cell is less than 0. Can you check that your geometry is correct?

ocni-dtu commented 4 years ago

I unfortunately doesn't have the environment anymore. Try to use a version of CMF before 1.2. It looks like they changed how the handled geotry in 1.2: https://github.com/philippkraft/cmf/releases

muc-martin commented 4 years ago

I checked the geometry and it is a valid .obj file with all geometry included. Downgrading CMF to 1.1.1 (or lower) results in the following error:

Traceback (most recent call last): File "C:\livestock\Examples1\CMF_Slope_v1\cmf\cmf_template.py", line 2, in from livestock.hydrology import run_model File "C:\Anaconda\envs\test1\lib\site-packages\livestock\hydrology.py", line 10, in import cmf.geometry ModuleNotFoundError: No module named 'cmf.geometry'