Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
665ea89
💥✅ corrai updates for optimisation (ModelicaFunction)
Tesshub Aug 13, 2025
8ae0fd0
📝update of simulate()
Tesshub Aug 22, 2025
44f7494
📝update of tutorial
Tesshub Aug 22, 2025
9a7399f
🎨new structure for boundary conditions
Tesshub Sep 2, 2025
c7029a0
📝tuto update
Tesshub Sep 2, 2025
5322929
📌requirements for corrai
Tesshub Sep 2, 2025
efd295a
📌requirements for corrai in setup.py
Tesshub Sep 2, 2025
e20b569
📌adptation of verbose change from ompython and is_dynamic added
Tesshub Nov 7, 2025
8122e80
📌adaptation to new version of OMPYTHON
Tesshub Nov 17, 2025
578b329
✅📌adaptation of tests to new version of OMPYTHON and corrai #todo for…
Tesshub Nov 17, 2025
a9407ad
📝documentation update
Tesshub Nov 17, 2025
309e893
📝updating datetimng handling
Tesshub Nov 17, 2025
388b134
📝updating turotial
Tesshub Nov 17, 2025
187fc8a
✅final fix
Tesshub Nov 21, 2025
37a2f88
test
Tesshub Nov 26, 2025
64ccb49
🐛 Fix of start date
Tesshub Dec 12, 2025
3197bd1
⚰️ drop corrai connector
BaptisteDE Dec 16, 2025
0796bd9
🚧 Massive update
BaptisteDE Dec 19, 2025
0571603
🚧 Update to ompython >= 4.
BaptisteDE Dec 22, 2025
33f4971
🐛 forgot to set properties
BaptisteDE Jan 5, 2026
4a8887d
🐛 Fix simulate duplicate (done later in code)
Tesshub Jan 15, 2026
77afc8b
✅ ignore silent metadata from second frequency
Tesshub Jan 15, 2026
8eb9ce4
🐛✅ startTime always taken into account now
Tesshub Jan 23, 2026
0d46b59
🐛✅ Problem with boundaries fixed as well
Tesshub Jan 23, 2026
36006f1
📝final update of documentation and tutorial
Tesshub Jan 23, 2026
1af1576
Merge branch 'main' into corrai_adaptations
Tesshub Jan 23, 2026
3ef63aa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 23, 2026
c74c352
⬆️
BaptisteDE Jan 23, 2026
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
13 changes: 6 additions & 7 deletions modelitool/combitabconvert.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime as dt
from pathlib import Path

import pandas as pd

Expand Down Expand Up @@ -33,7 +34,7 @@ def get_dymo_time_index(df):
return list(pd.Series(sec_dt).cumsum())


def df_to_combitimetable(df, filename):
def write_combitt_from_df(df: pd.DataFrame, file_path: Path | str):
"""
Write a text file compatible with modelica Combitimetables object from a
Pandas DataFrame with a DatetimeIndex. DataFrames with non monotonically increasing
Expand All @@ -45,18 +46,15 @@ def df_to_combitimetable(df, filename):
"""
if not isinstance(df, pd.DataFrame):
raise ValueError(f"df must be an instance of pandas DataFrame. Got {type(df)}")
if not isinstance(df.index, pd.DatetimeIndex):
raise ValueError(
f"DataFrame index must be an instance of DatetimeIndex. " f"Got {type(df)}"
)

if not df.index.is_monotonic_increasing:
raise ValueError(
"df DateTimeIndex is not monotonically increasing, this will"
"cause Modelica to crash."
)

df = df.copy()
with open(filename, "w") as file:
with open(file_path, "w") as file:
file.write("#1 \n")
line = ""
line += f"double table1({df.shape[0]}, {df.shape[1] + 1})\n"
Expand All @@ -65,6 +63,7 @@ def df_to_combitimetable(df, filename):
line += f"\t({i + 1}){col}"
file.write(f"{line} \n")

df.index = datetime_to_seconds(df.index)
if isinstance(df.index, pd.DatetimeIndex):
df.index = datetime_to_seconds(df.index)

file.write(df.to_csv(header=False, sep="\t", lineterminator="\n"))
137 changes: 0 additions & 137 deletions modelitool/corrai_connector.py

This file was deleted.

Loading
Loading