diff --git a/docs/Makefile b/docs/Makefile index eff518ab..fbc248eb 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -96,6 +96,18 @@ publish: git checkout @{-1} git stash pop +publish-release: publish + make clean + git stash + git checkout main + make html + -git add -f "$(BUILDDIR)" + -git commit -m "Latest docs build." "$(BUILDDIR)" + git push origin main -f + make clean + git checkout @{-1} + git stash pop + apidocs: build-dir sphinx-apidoc -f -T -o classes ../spatialpy diff --git a/requirements.txt b/requirements.txt index aee8dc7d..54f4a168 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -pygmsh>=5.0.2 -meshio>=2.3.10 +meshio>=5.3.2 scipy>=1.4.1 plotly>=4.1.0 diff --git a/spatialpy/core/domain.py b/spatialpy/core/domain.py index de321993..27e6445a 100644 --- a/spatialpy/core/domain.py +++ b/spatialpy/core/domain.py @@ -715,11 +715,13 @@ def import_meshio_object(cls, mesh_obj): #vertices obj.vertices = mesh_obj.points # triangles - if 'triangle' in mesh_obj.cells: - obj.triangles = mesh_obj.cells['triangle'] + triangles = list(filter(lambda cell: cell.type == "triangle", mesh_obj.cells)) + if triangles: + obj.triangles = triangles[0].data #tetrahedrons - if 'tetra' in mesh_obj.cells: - obj.tetrahedrons = mesh_obj.cells['tetra'] + tetras = list(filter(lambda cell: cell.type == "tetra", mesh_obj.cells)) + if tetras: + obj.tetrahedrons = tetras[0].data # volume obj.calculate_vol() if not numpy.count_nonzero(obj.vol): @@ -742,16 +744,12 @@ def read_msh_file(cls, filename): :returns: SpatialPy Domain object created from the mesh file. :rtype: spatialpy.Domain.Domain """ - try: - import pygmsh # pylint: disable=import-outside-toplevel - except ImportError as err: - raise DomainError("The python package 'pygmsh' is not installed.") from err try: import meshio # pylint: disable=import-outside-toplevel except ImportError as err: raise DomainError("The python package 'meshio' is not installed.") from err - return cls.import_meshio_object(meshio.msh_io.read(filename)) + return cls.import_meshio_object(meshio.read(filename)) def read_stochss_subdomain_file(self, filename, type_ids=None): """