nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: xgcm/xgcm
Pull request #218 (2020-09-02 21:38:57)

Bugfix: axis fillval parsing from dict input
Fix for #215 


Patch:
diff --git a/xgcm/grid.py b/xgcm/grid.py
index 745333b..5712976 100644
--- a/xgcm/grid.py
+++ b/xgcm/grid.py
@@ -930,7 +930,7 @@ class Grid:
                 default_shifts=axis_default_shifts,
                 coords=coords.get(axis_name),
                 boundary=axis_boundary,
-                fill_value=fill_value,
+                fill_value=axis_fillvalue,
             )
 
         if face_connections is not None:


Test patch:
diff --git a/xgcm/test/test_grid.py b/xgcm/test/test_grid.py
index 737d4ba..3463689 100644
--- a/xgcm/test/test_grid.py
+++ b/xgcm/test/test_grid.py
@@ -707,6 +707,15 @@ def test_multi_axis_input(all_datasets, func, periodic, boundary):
         xr.testing.assert_allclose(serial, full)
 
 
+def test_grid_dict_input_boundary_fill(nonperiodic_1d):
+    """Test axis kwarg input functionality using dict input"""
+    ds, _, _ = nonperiodic_1d
+    grid_direct = Grid(ds, periodic=False, boundary="fill", fill_value=5)
+    grid_dict = Grid(ds, periodic=False, boundary={"X": "fill"}, fill_value={"X": 5})
+    assert grid_direct.axes["X"].fill_value == grid_dict.axes["X"].fill_value
+    assert grid_direct.axes["X"].boundary == grid_dict.axes["X"].boundary
+
+
 def test_invalid_boundary_error():
     ds = datasets["1d_left"]
     with pytest.raises(ValueError):
Repository: xgcm/xgcm
Pull request #383 (2021-10-25 19:54:52)

Keep coords deprecation warning
 - [x] First part of closing #382
 - [x] Tests added
 - [x] Passes `pre-commit run --all-files`
 - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst`



Patch:
diff --git a/doc/whats-new.rst b/doc/whats-new.rst
index fbce3dd..4651115 100644
--- a/doc/whats-new.rst
+++ b/doc/whats-new.rst
@@ -42,6 +42,14 @@ Internal Changes
   By `Tom Nicholas <https://github.com/TomNicholas>`_.[*]_
 
 
+Deprecations
+~~~~~~~~~~~~~
+
+- The `keep_coords` kwarg is now deprecated, and will be removed in the next version. (:issue:`382`)
+  By `Tom Nicholas <https://github.com/TomNicholas>`_.[*]_
+
+
+
 v0.5.2 (2021/5/27)
 -------------------
 
diff --git a/xgcm/grid.py b/xgcm/grid.py
index 0c5308f..777829f 100644
--- a/xgcm/grid.py
+++ b/xgcm/grid.py
@@ -1070,6 +1070,14 @@ class Axis:
         Take the base coords from da, the data from data_new, and return
         a new DataArray with a coordinate on position_to.
         """
+
+        if not keep_coords:
+            warnings.warn(
+                "The keep_coords keyword argument is being deprecated - in future it will be removed "
+                "entirely, and the behaviour will always be that currently given by keep_coords=True.",
+                category=DeprecationWarning,
+            )
+
         position_from, old_dim = self._get_position_name(da)
         try:
             new_dim = self.coords[position_to]


Test patch:
diff --git a/xgcm/test/test_grid.py b/xgcm/test/test_grid.py
index 5ffca92..8df2359 100644
--- a/xgcm/test/test_grid.py
+++ b/xgcm/test/test_grid.py
@@ -771,6 +771,15 @@ def test_keep_coords(funcname, gridtype):
             assert set(result.coords) == set(base_coords + augmented_coords)
 
 
+def test_keep_coords_deprecation():
+    ds, coords, metrics = datasets_grid_metric("B")
+    ds = ds.assign_coords(yt_bis=ds["yt"], xt_bis=ds["xt"])
+    grid = Grid(ds, coords=coords, metrics=metrics)
+    for axis_name in grid.axes.keys():
+        with pytest.warns(DeprecationWarning):
+            grid.diff(ds.tracer, axis_name, keep_coords=False)
+
+
 def test_boundary_kwarg_same_as_grid_constructor_kwarg():
     ds = datasets["2d_left"]
     grid1 = Grid(ds, periodic=False)
Repository: xgcm/xgcm
Pull request #385 (2021-12-03 16:28:28)

Documented removal of docrep dependency, and updated whatsnew to v0.6.1
For the release of v0.6.0 today.


Patch:
diff --git a/doc/whats-new.rst b/doc/whats-new.rst
index fbce3dd..dbfb387 100644
--- a/doc/whats-new.rst
+++ b/doc/whats-new.rst
@@ -3,7 +3,25 @@
 What's New
 ===========
 
-v0.6.0 (unreleased)
+v0.6.1 (unreleased)
+-------------------
+
+.. _whats-new.0.6.1:
+
+New Features
+~~~~~~~~~~~~
+
+Breaking Changes
+~~~~~~~~~~~~~~~~
+
+Documentation
+~~~~~~~~~~~~~
+
+Internal Changes
+~~~~~~~~~~~~~
+
+
+v0.6.0 (2021/11/03)
 -------------------
 
 .. _whats-new.0.6.0:
@@ -41,6 +59,18 @@ Internal Changes
 - Fixed metrics tests so some tests that previously did not run now do run, and refactored the metrics tests.
   By `Tom Nicholas <https://github.com/TomNicholas>`_.[*]_
 
+- Removed dependency on docrep, which as docrep 2.7 used a GPL licence, implicitly changed the license of xGCM.
+  Therefore xGCM now has a valid MIT license, instead of accidentally being a GPL licence as it was before.
+  (:issue:`308`, :pull:`384`)
+  By `Tom Nicholas <https://github.com/TomNicholas>`_.[*]_
+
+Deprecations
+~~~~~~~~~~~~~
+
+- The `keep_coords` kwarg is now deprecated, and will be removed in the next version. (:issue:`382`)
+  By `Tom Nicholas <https://github.com/TomNicholas>`_.[*]_
+
+
 
 v0.5.2 (2021/5/27)
 -------------------
diff --git a/xgcm/grid.py b/xgcm/grid.py
index 0c5308f..777829f 100644
--- a/xgcm/grid.py
+++ b/xgcm/grid.py
@@ -1070,6 +1070,14 @@ class Axis:
         Take the base coords from da, the data from data_new, and return
         a new DataArray with a coordinate on position_to.
         """
+
+        if not keep_coords:
+            warnings.warn(
+                "The keep_coords keyword argument is being deprecated - in future it will be removed "
+                "entirely, and the behaviour will always be that currently given by keep_coords=True.",
+                category=DeprecationWarning,
+            )
+
         position_from, old_dim = self._get_position_name(da)
         try:
             new_dim = self.coords[position_to]


Test patch:
diff --git a/xgcm/test/test_grid.py b/xgcm/test/test_grid.py
index 5ffca92..8df2359 100644
--- a/xgcm/test/test_grid.py
+++ b/xgcm/test/test_grid.py
@@ -771,6 +771,15 @@ def test_keep_coords(funcname, gridtype):
             assert set(result.coords) == set(base_coords + augmented_coords)
 
 
+def test_keep_coords_deprecation():
+    ds, coords, metrics = datasets_grid_metric("B")
+    ds = ds.assign_coords(yt_bis=ds["yt"], xt_bis=ds["xt"])
+    grid = Grid(ds, coords=coords, metrics=metrics)
+    for axis_name in grid.axes.keys():
+        with pytest.warns(DeprecationWarning):
+            grid.diff(ds.tracer, axis_name, keep_coords=False)
+
+
 def test_boundary_kwarg_same_as_grid_constructor_kwarg():
     ds = datasets["2d_left"]
     grid1 = Grid(ds, periodic=False)