Skip to content

Commit

Permalink
Merge pull request #188 from NOAA-OWP/set_crs_deprecation
Browse files Browse the repository at this point in the history
Replace deprecated set_crs function
  • Loading branch information
fernando-aristizabal committed Jul 24, 2024
2 parents 19f8c1d + c84bd47 commit 1d0a21b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = [
requires-python = ">=3.8"
keywords = ["geospatial", "evaluations"]
license = {text = "MIT"}
version = "0.2.7"
version = "0.2.7-1"
dynamic = ["readme", "dependencies"]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/gval/comparison/agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _manage_information_loss(agreement_map, crs, nodata, encode_nodata, dtype):
"""

# sets CRS that is lost with `xr.apply_ufunc`
agreement_map.rio.set_crs(crs, inplace=True)
agreement_map.rio.write_crs(crs, inplace=True)

# setting agreement map nodata and encoded nodata
if nodata is not None:
Expand Down
2 changes: 1 addition & 1 deletion tests/data_generation/data_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def generate_aligned_and_agreement_maps(
allow_benchmark_values=allow_benchmark_values,
)

agreement_map_computed.rio.set_crs(cam.rio.crs)
agreement_map_computed.rio.write_crs(cam.rio.crs, inplace=True)

agreement_map_computed.rio.set_nodata(-9999)
if np.nan in agreement_map_computed:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
glob="categorical_plot_success",
)
def test_categorical_plot_success(candidate_map, crs, entries):
candidate_map.rio.set_crs(crs)
candidate_map.rio.write_crs(crs, inplace=True)
viz_object = candidate_map.gval.cat_plot(basemap=None)
assert len(viz_object.axes.get_legend().texts) == entries

Expand Down

0 comments on commit 1d0a21b

Please sign in to comment.