Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.12 support #233

Merged
merged 3 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading