Skip to content

Commit

Permalink
style: added verbose coding of in_place catalog filtering
Browse files Browse the repository at this point in the history
fix: bypassed a pycsep error where sometimes CartesianGrid2D are not imported with a proper dh
  • Loading branch information
pabloitu committed Dec 6, 2023
1 parent 8683eb1 commit 6f5ce41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions floatcsep/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,11 @@ def read_region_cfg(region_config, **kwargs):
except ValueError:
data = numpy.array([re.split(r'\s+|,', i.strip()) for i in
parsed_region[1:]], dtype=float)
dh1 = scipy.stats.mode(np.diff(np.unique(data[:, 0]))).mode
dh2 = scipy.stats.mode(np.diff(np.unique(data[:, 1]))).mode
dh = np.min([dh1, dh2])
dh1 = scipy.stats.mode(
numpy.diff(numpy.unique(data[:, 0]))).mode
dh2 = scipy.stats.mode(
numpy.diff(numpy.unique(data[:, 1]))).mode
dh = numpy.nanmin([dh1, dh2])
region = CartesianGrid2D.from_origins(data,
name=region_data,
magnitudes=magnitudes,
Expand Down

0 comments on commit 6f5ce41

Please sign in to comment.