Skip to content

Commit 6f5ce41

Browse files
committed
style: added verbose coding of in_place catalog filtering
fix: bypassed a pycsep error where sometimes CartesianGrid2D are not imported with a proper dh
1 parent 8683eb1 commit 6f5ce41

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

floatcsep/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,11 @@ def read_region_cfg(region_config, **kwargs):
220220
except ValueError:
221221
data = numpy.array([re.split(r'\s+|,', i.strip()) for i in
222222
parsed_region[1:]], dtype=float)
223-
dh1 = scipy.stats.mode(np.diff(np.unique(data[:, 0]))).mode
224-
dh2 = scipy.stats.mode(np.diff(np.unique(data[:, 1]))).mode
225-
dh = np.min([dh1, dh2])
223+
dh1 = scipy.stats.mode(
224+
numpy.diff(numpy.unique(data[:, 0]))).mode
225+
dh2 = scipy.stats.mode(
226+
numpy.diff(numpy.unique(data[:, 1]))).mode
227+
dh = numpy.nanmin([dh1, dh2])
226228
region = CartesianGrid2D.from_origins(data,
227229
name=region_data,
228230
magnitudes=magnitudes,

0 commit comments

Comments
 (0)