Skip to content

Commit

Permalink
Merge pull request #323 from PyPSA/fix/deprecation-warning-pandas-1.4
Browse files Browse the repository at this point in the history
Fix deprecation warning for 'closed' with pandas 1.4
  • Loading branch information
fneum authored Feb 11, 2023
2 parents 9aab1e5 + 4a106aa commit 8d072a0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ countries: ['AL', 'AT', 'BA', 'BE', 'BG', 'CH', 'CZ', 'DE', 'DK', 'EE', 'ES', 'F
snapshots:
start: "2013-01-01"
end: "2014-01-01"
closed: 'left' # end is not inclusive
inclusive: 'left' # include start, not end

enable:
prepare_links_p_nom: false
Expand Down
2 changes: 1 addition & 1 deletion config.tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ countries: ['BE']
snapshots:
start: "2013-03-01"
end: "2013-04-01"
closed: 'left' # end is not inclusive
inclusive: 'left' # include start, not end

enable:
prepare_links_p_nom: false
Expand Down
2 changes: 1 addition & 1 deletion doc/configtables/snapshots.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
,Unit,Values,Description
start,--,"str or datetime-like; e.g. YYYY-MM-DD","Left bound of date range"
end,--,"str or datetime-like; e.g. YYYY-MM-DD","Right bound of date range"
closed,--,"One of {None, ‘left’, ‘right’}","Make the time interval closed to the ``left``, ``right``, or open on both sides ``None``."
inclusive,--,"One of {'neither', 'both', ‘left’, ‘right’}","Make the time interval closed to the ``left``, ``right``, or both sides ``both`` or neither side ``None``."
13 changes: 11 additions & 2 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@ Release Notes
Upcoming Release
================

* Carriers of generators can now be excluded from aggregation in clustering network and simplify network.

* Fix EQ constraint for the case no hydro inflow is available

* Bugfix in the reserve constraint will increase demand related reserve requirements

**New Features**

* Carriers of generators can now be excluded from aggregation in clustering network and simplify network.

**Breaking Changes**

* The config entry ``snapshots["closed"]`` was renamed to ``snapshots["inclusive"]`` to address the upstream deprecation with ``pandas=1.4``.
The previous setting ``None`` is no longer supported and replaced by ``both``, see the `pandas documentation <https://pandas.pydata.org/docs/reference/api/pandas.date_range.html>`_.
Minimum ``pandas`` version now required is `>= 1.4`.


PyPSA-Eur 0.6.1 (20th September 2022)
=====================================

Expand Down
4 changes: 2 additions & 2 deletions envs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ dependencies:
- yaml
- pytables
- lxml
- powerplantmatching>=0.5.5
- powerplantmatching>=0.5.4
- numpy<1.24
- pandas
- pandas>=1.4
- geopandas>=0.11.0
- xarray
- netcdf4
Expand Down
2 changes: 1 addition & 1 deletion test/config.test1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ countries: ['BE']
snapshots:
start: "2013-03-01"
end: "2013-03-08"
closed: 'left' # end is not inclusive
inclusive: 'left' # include start, not end

enable:
prepare_links_p_nom: false
Expand Down

0 comments on commit 8d072a0

Please sign in to comment.