From dbe87d9096c0cbd0f6e53a178b333a6de9d0f4ea Mon Sep 17 00:00:00 2001 From: trevorb1 Date: Sun, 22 Sep 2024 15:29:24 -0700 Subject: [PATCH 1/3] address pandas future warning --- src/otoole/input.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/otoole/input.py b/src/otoole/input.py index e1082f7..d5a22e6 100644 --- a/src/otoole/input.py +++ b/src/otoole/input.py @@ -561,7 +561,12 @@ def _expand_dataframe( default_df = self._get_default_dataframe(name, input_data, default_values) - df = pd.concat([df, default_df]) + # future warning of concating empty dataframe + if not df.empty: + df = pd.concat([df, default_df]) + else: + df = default_df.copy() + df = df[~df.index.duplicated(keep="first")] df = self._check_index_dtypes(name, self.user_config[name], df) From 4d44ee6261ce5f8fb5b8ad465e399d237262e485 Mon Sep 17 00:00:00 2001 From: trevorb1 Date: Sun, 22 Sep 2024 15:34:00 -0700 Subject: [PATCH 2/3] Add python 3.12 testing --- .github/workflows/python.yaml | 2 +- CHANGELOG.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 835a4e4..8fd0cb9 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest] steps: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bdc2c67..09225b2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,8 @@ Changelog =========================== - Lock pandas to 2.1.4 or later - Capital Investment result calculation fixed +- Defults expansion moved to ReadStrategy +- Adds Python 3.12 support Version 1.1.2 ============= From 2ec9ce33522cc3e8fc492c11fb7c6c210c06c1d6 Mon Sep 17 00:00:00 2001 From: trevorb1 Date: Sun, 22 Sep 2024 15:39:21 -0700 Subject: [PATCH 3/3] updated python badge --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index df34843..a34821a 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ otoole: OSeMOSYS tools for energy work :target: https://github.com/psf/black :alt: Code Style -.. image:: https://img.shields.io/badge/python-3.9_|_3.10_|_3.11-blue.svg +.. image:: https://img.shields.io/badge/python-3.9_|_3.10_|_3.11|_3.12-blue.svg :target: https://crate.io/packages/otoole/ :alt: Python Version