Skip to content

Commit

Permalink
move regionmaskcompat to core (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause authored Sep 4, 2023
1 parent 4e2b408 commit 4b66b70
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mesmer/core/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import regionmask
import xarray as xr

import mesmer.utils
import mesmer


def _where_if_dim(obj, cond, dims):
Expand Down Expand Up @@ -56,10 +56,10 @@ def mask_ocean_fraction(data, threshold, *, x_coords="lon", y_coords="lat"):
land_110 = regionmask.defined_regions.natural_earth_v5_0_0.land_110

try:
mask_fraction = mesmer.utils.regionmaskcompat.mask_3D_frac_approx(
mask_fraction = mesmer.core.regionmaskcompat.mask_3D_frac_approx(
land_110, data[x_coords], data[y_coords]
)
except mesmer.utils.regionmaskcompat.InvalidCoordsError as e:
except mesmer.core.regionmaskcompat.InvalidCoordsError as e:
raise ValueError(
"Cannot calculate fractional mask for irregularly-spaced coords - use "
"``mask_land`` instead."
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mesmer/io/load_constant_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import regionmask
from packaging.version import Version

from ..utils.regionmaskcompat import mask_3D_frac_approx
from ..core.regionmaskcompat import mask_3D_frac_approx


def load_phi_gc(lon, lat, ls, cfg, L_start=1500, L_end=10000, L_interval=250):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_regionmaskcompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import shapely.geometry
import xarray as xr

from mesmer.utils.regionmaskcompat import (
from mesmer.core.regionmaskcompat import (
InvalidCoordsError,
mask_3D_frac_approx,
sample_coord,
Expand Down

0 comments on commit 4b66b70

Please sign in to comment.