diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index fbbe5c21..030cf46e 100755 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -34,6 +34,8 @@ Version 0.2.14 * Numpy version temporarily limited to <2. +- Remove long deprecated functions and cutout arguments / attributes. + Version 0.2.13 ============== diff --git a/atlite/cutout.py b/atlite/cutout.py index 5a636e6f..9e64b994 100644 --- a/atlite/cutout.py +++ b/atlite/cutout.py @@ -139,15 +139,6 @@ def __init__(self, path, **cutoutparams): Whether to open dataset in parallel mode. Take effect for all xr.open_mfdataset usages. """ - name = cutoutparams.get("name", None) - cutout_dir = cutoutparams.get("cutout_dir", None) - if cutout_dir or name or Path(path).is_dir(): - raise ValueError( - "Old style format not supported. You can migrate the old " - "cutout directory using the function " - "`atlite.utils.migrate_from_cutout_directory()`. The argument " - "`cutout_dir` and `name` have been deprecated in favour of `path`." - ) path = Path(path).with_suffix(".nc") chunks = cutoutparams.pop("chunks", {"time": 100}) @@ -156,31 +147,6 @@ def __init__(self, path, **cutoutparams): else: storable_chunks = {} - # Backward compatibility for xs, ys, months and years - if {"xs", "ys"}.intersection(cutoutparams): - warn( - "The arguments `xs` and `ys` have been deprecated in favour of " - "`x` and `y`", - DeprecationWarning, - ) - if "xs" in cutoutparams: - cutoutparams["x"] = cutoutparams.pop("xs") - if "ys" in cutoutparams: - cutoutparams["y"] = cutoutparams.pop("ys") - - if {"years", "months"}.intersection(cutoutparams): - warn( - "The arguments `years` and `months` have been deprecated in " - "favour of `time`", - DeprecationWarning, - ) - assert "years" in cutoutparams - months = cutoutparams.pop("months", slice(1, 12)) - years = cutoutparams.pop("years") - cutoutparams["time"] = slice( - f"{years.start}-{months.start}", f"{years.stop}-{months.stop}" - ) - # Three cases. First, cutout exists -> take the data. # Second, data is given -> take it. Third, else -> build a new cutout if path.is_file(): @@ -279,20 +245,6 @@ def coords(self): """ return self.data.coords - @property - def meta(self): - """ - Metadata of the cutout. - - Deprecated since v0.2. - """ - warn( - "The `meta` attribute is deprecated in favour of direct " - "access to `data`", - DeprecationWarning, - ) - return xr.Dataset(self.coords, attrs=self.data.attrs) - @property def shape(self): """ diff --git a/atlite/gis.py b/atlite/gis.py index 66e3a244..e8e629b9 100644 --- a/atlite/gis.py +++ b/atlite/gis.py @@ -103,19 +103,6 @@ def _reproject_shape(shape): return list(map(_reproject_shape, shapes)) -def reproject(shapes, p1, p2): - """ - Project a collection of shapes from one crs to another. - - Deprecated since version 0.2. - """ - warn("reproject has been renamed to reproject_shapes", DeprecationWarning) - return reproject_shapes(shapes, p1, p2) - - -reproject.__doc__ = reproject_shapes.__doc__ - - def compute_indicatormatrix(orig, dest, orig_crs=4326, dest_crs=4326): """ Compute the indicatormatrix. diff --git a/atlite/utils.py b/atlite/utils.py index 14a3ae2f..3e1857fd 100644 --- a/atlite/utils.py +++ b/atlite/utils.py @@ -23,39 +23,6 @@ logger = logging.getLogger(__name__) -def make_optional_progressbar(show, prefix, max_value=None): - warnings.warn( - "make_optional_progressbar() is deprecated and will be removed " - "in the next version.", - warnings.DeprecationWarning, - ) - if show: - widgets = [ - pgb.widgets.Percentage(), - " ", - pgb.widgets.SimpleProgress( - format="(%s)" % pgb.widgets.SimpleProgress.DEFAULT_FORMAT - ), - " ", - pgb.widgets.Bar(), - " ", - pgb.widgets.Timer(), - " ", - pgb.widgets.ETA(), - ] - if not prefix.endswith(": "): - prefix = prefix.strip() + ": " - maybe_progressbar = pgb.ProgressBar( - prefix=prefix, widgets=widgets, max_value=max_value - ) - else: - - def maybe_progressbar(x): - return x - - return maybe_progressbar - - def migrate_from_cutout_directory(old_cutout_dir, path): """ Convert an old style cutout directory to new style netcdf file.