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 ============= 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 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)