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

Maintenance/fix warnings #98

Merged
merged 7 commits into from
Sep 5, 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/full_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.12"]
python-version: ["3.9", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.12'
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For other MIKE files (Dfs0, Dfs1, Dfs2, Dfsu,...) use the related package [MIKE

## Requirements
* Windows operating system (Support for Linux is experimental)
* Python x64 3.6, 3.7 or 3.8
* Python x64 3.9, 3.10, 3.11 or 3.12
* [VC++ redistributables](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) (already installed if you have MIKE)

## Installation
Expand Down
2 changes: 1 addition & 1 deletion mikeio1d/pandas_extension/result_frame_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def _finalize_df_post_aggregate(self, df: pd.DataFrame) -> pd.DataFrame:
for level in self._quantity_levels:
if level not in df.columns.names:
continue
df = df.stack(level)
df = df.stack(level, future_stack=True)

df = df.T

Expand Down
4 changes: 1 addition & 3 deletions mikeio1d/result_network/result_reach.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ def try_set_static_attribute_length(self):
try:
self.set_static_attribute("length", self._get_total_length())
except Exception as _:
warnings.warn(
"Length attribute not included. For SWMM and EPANET results this is not implemented."
)
pass

def add_res1d_reach(self, reach):
"""
Expand Down
8 changes: 7 additions & 1 deletion mikeio1d/result_reader_writer/result_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from typing import List
from typing import Optional

import warnings

from enum import Enum
from abc import ABC
from abc import abstractmethod
Expand Down Expand Up @@ -283,7 +285,11 @@ def update_time_quantities(self, df: pd.DataFrame):
simulation_start + datetime.timedelta(seconds=s)
for s in seconds_since_simulation_started
]
df.iloc[:, i] = datetime_since_simulation_started

# Suppress casting warning for now with hope that it will be fixed by pandas in the future.
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=FutureWarning)
df.iloc[:, i] = datetime_since_simulation_started

def _is_lts_event_time_column(
self,
Expand Down
85 changes: 65 additions & 20 deletions notebooks/epanet_res.ipynb

Large diffs are not rendered by default.

81 changes: 63 additions & 18 deletions notebooks/epanet_resx.ipynb

Large diffs are not rendered by default.

Loading
Loading