Skip to content

Commit

Permalink
Deal with new discretize warning (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae authored Jan 10, 2025
1 parent 1478065 commit 3766e5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ jobs:
- python-version: "3.11"
name: full
os: ubuntu
conda: "scipy numba 'empymod>=2.3.2' xarray tqdm h5py discretize matplotlib"
conda: "scipy numba 'empymod>=2.3.2' xarray tqdm h5py 'discretize>=0.11' matplotlib"
- python-version: "3.12"
name: plain
os: ubuntu
conda: "scipy numba 'empymod>=2.3.2'"
- python-version: "3.12"
name: full
os: ubuntu
conda: "scipy numba 'empymod>=2.3.2' xarray tqdm h5py discretize matplotlib"
conda: "scipy numba 'empymod>=2.3.2' xarray tqdm h5py 'discretize>=0.11' matplotlib"

env:
# Used for coveralls flag
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ docs = [
]
tests = [
"flake8",
"discretize>=0.11",
"pytest",
"coveralls",
"pytest_cov",
Expand Down
1 change: 1 addition & 0 deletions tests/test_electrodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ def adj(v):
shape_u=mesh.n_edges, shape_v=1,
complex_u=rng.choice([True, False]), # Random float or complex.
complex_v=rng.choice([True, False]), # Random float or complex.
random_seed=rng,
)


Expand Down
7 changes: 6 additions & 1 deletion tests/test_simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ def test_adjoint(self, tmpdir):
sim.jtvec,
self.mesh.shape_cells,
self.survey.shape,
random_seed=rng,
)

sim = simulations.Simulation(
Expand All @@ -900,6 +901,7 @@ def test_adjoint(self, tmpdir):
sim.jtvec,
self.mesh.shape_cells,
self.survey.shape,
random_seed=rng,
)

@pytest.mark.skipif(discretize is None, reason="discretize not installed.")
Expand All @@ -920,6 +922,7 @@ def test_adjoint_hti(self):
sim.jtvec,
(2, *self.mesh.shape_cells),
self.survey.shape,
random_seed=rng,
)

@pytest.mark.skipif(discretize is None, reason="discretize not installed.")
Expand All @@ -940,6 +943,7 @@ def test_adjoint_vti(self):
sim.jtvec,
(2, *self.mesh.shape_cells),
self.survey.shape,
random_seed=rng,
)

@pytest.mark.skipif(discretize is None, reason="discretize not installed.")
Expand All @@ -961,6 +965,7 @@ def test_adjoint_triaxial(self):
sim.jtvec,
(3, *self.mesh.shape_cells),
self.survey.shape,
random_seed=rng,
)

@pytest.mark.skipif(discretize is None, reason="discretize not installed.")
Expand All @@ -986,7 +991,7 @@ def func1(x):
return sim.data.synthetic.data, func2

assert discretize.tests.check_derivative(
func1, m0, plotIt=False, num=3,
func1, m0, plotIt=False, num=3, random_seed=rng,
)

@pytest.mark.skipif(discretize is None, reason="discretize not installed.")
Expand Down

0 comments on commit 3766e5b

Please sign in to comment.