Skip to content

Commit

Permalink
Ensure data is available at the start, not 1 ms too late
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Sep 23, 2024
1 parent ba469e5 commit 9d0d0c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/ribasim/ribasim/delwaq/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _make_boundary(data, boundary_type):
.reset_index(drop=True)
)
# Convert Arrow time to Numpy to avoid needing tzdata somehow
piv.time = pd.to_datetime(piv.time).dt.strftime("%Y-%m-%d %H:%M:%S")
piv.time = piv.time.astype("datetime64[ns]").dt.strftime("%Y-%m-%d %H:%M:%S")

Check warning on line 78 in python/ribasim/ribasim/delwaq/generate.py

View check run for this annotation

Codecov / codecov/patch

python/ribasim/ribasim/delwaq/generate.py#L78

Added line #L78 was not covered by tests
boundary = {
"name": bid,
"substances": list(map(_quote, piv.columns[1:])),
Expand Down
12 changes: 6 additions & 6 deletions python/ribasim_testmodels/ribasim_testmodels/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ def tabulated_rating_curve_model() -> ribasim.Model:
tabulated_rating_curve.Time(
time=[
# test millisecond precision
pd.Timestamp("2020-01-01 00:00:00.001"),
pd.Timestamp("2020-01-01 00:00:00.001"),
pd.Timestamp("2020-02"),
pd.Timestamp("2020-02"),
pd.Timestamp("2020-03"),
pd.Timestamp("2020-03"),
pd.Timestamp("2020-01-01"),
pd.Timestamp("2020-01-01"),
pd.Timestamp("2020-02-01 00:00:00.001"),
pd.Timestamp("2020-02-01 00:00:00.001"),
pd.Timestamp("2020-03-01"),
pd.Timestamp("2020-03-01"),
],
level=[0.0, 1.0, 0.0, 1.1, 0.0, 1.2],
flow_rate=[0.0, 10 / 86400, 0.0, 10 / 86400, 0.0, 10 / 86400],
Expand Down

0 comments on commit 9d0d0c7

Please sign in to comment.