Skip to content

Commit

Permalink
Move nanomesh to optional dependencies since it's not on conda-forge
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-sadeghi committed Mar 12, 2024
1 parent 1871170 commit 94db442
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies = [
"scipy",
"tqdm",
"pywavelets",
"nanomesh",
"setuptools",
]
readme = "README.md"
Expand All @@ -58,6 +57,7 @@ test = [
]
extras = [
"imageio",
"nanomesh",
"numpy-stl",
"pyevtk",
"scikit-fmm",
Expand Down Expand Up @@ -137,8 +137,6 @@ python_classes = "*Test"
python_functions = "test_*"
testpaths = ["test", "examples"]
norecursedirs = [".git", ".github", ".ipynb_checkpoints", "build", "dist"]
# filterwarnings = ["error", "ignore::UserWarning", "ignore::DeprecationWarning"]
# -p no:warnings

[tool.coverage.run]
source = ["src/porespy"]
Expand Down
7 changes: 6 additions & 1 deletion src/porespy/generators/_micromodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
import scipy.ndimage as spim
import scipy.stats as spst
from nanomesh import Mesher2D

from porespy.generators import borders, lattice_spheres, spheres_from_coords
from porespy.tools import _insert_disks_at_points_parallel, extend_slice
Expand Down Expand Up @@ -286,6 +285,12 @@ def cylindrical_pillars_mesh(
to view online example.
"""
try:
from nanomesh import Mesher2D
except ModuleNotFoundError:
msg = "The nanomesh package can be installed with `pip install nanomesh`"
raise ModuleNotFoundError(msg)

if len(shape) != 2:
raise Exception('shape must be 2D for this function')
if n is None:
Expand Down

0 comments on commit 94db442

Please sign in to comment.