Skip to content

Commit 826b686

Browse files
authored
Merge pull request #76 from MiraGeoscience/GEOPY-2048
GEOPY-2048: Resolve deprecation warnings with latest simpeg 0.23 and discreatize 0.11
2 parents 0ca2bf6 + 5b02e34 commit 826b686

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

simpeg/dask/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,18 @@ def get_parallel_blocks(
5757
block_count += 1
5858
blocks.append([])
5959

60+
locs = rx.locations
61+
62+
if isinstance(locs, tuple):
63+
locs = locs[0]
64+
6065
blocks[block_count].append(
6166
(
6267
(s_id, r_id, ind),
6368
(
6469
chunk,
6570
np.arange(row_index, row_index + chunk_size).astype(int),
66-
rx.locations.shape[0],
71+
locs.shape[0],
6772
),
6873
)
6974
)

simpeg/data.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,10 @@ def relative_error(self):
163163
@relative_error.setter
164164
def relative_error(self, value):
165165
if value is not None:
166-
try:
166+
if not isinstance(value, np.ndarray):
167167
value = validate_float("relative_error", value)
168168
value = np.full(self.survey.nD, value)
169-
except TypeError:
170-
pass
169+
171170
value = validate_ndarray_with_shape(
172171
"relative_error", value, shape=(self.survey.nD,)
173172
)
@@ -206,11 +205,11 @@ def noise_floor(self):
206205
@noise_floor.setter
207206
def noise_floor(self, value):
208207
if value is not None:
209-
try:
208+
209+
if not isinstance(value, np.ndarray):
210210
value = validate_float("noise_floor", value)
211211
value = np.full(self.survey.nD, value)
212-
except TypeError:
213-
pass
212+
214213
value = validate_ndarray_with_shape(
215214
"noise_floor", value, shape=(self.survey.nD,)
216215
)

simpeg/directives/directives.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ def __init__(self, beta0_ratio=1.0, seed: RandomSeed | None = None, **kwargs):
614614
super().__init__(beta0_ratio=beta0_ratio, seed=seed, **kwargs)
615615

616616
def initialize(self):
617-
rng = np.random.default_rng(seed=self.seed)
617+
rng = np.random.default_rng(seed=self.random_seed)
618618

619619
if self.verbose:
620620
print("Calculating the beta0 parameter.")

0 commit comments

Comments
 (0)