Skip to content

Deps update #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pygmsh>=5.0.2
meshio>=2.3.10
meshio>=5.3.2
scipy>=1.4.1
plotly>=4.1.0
16 changes: 7 additions & 9 deletions spatialpy/core/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
"""
Expand Down