Skip to content

Commit

Permalink
Merge pull request #233 from OSeMOSYS/issue-212
Browse files Browse the repository at this point in the history
Add Python 3.12 support
  • Loading branch information
trevorb1 authored Sep 22, 2024
2 parents 8393bf3 + 2ec9ce3 commit 5fcd21e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=============
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion src/otoole/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5fcd21e

Please sign in to comment.