Skip to content

Commit d3c078a

Browse files
authored
Merge pull request #107 from WISDEM/develop
v0.8.1
2 parents ed3b184 + 45a37e7 commit d3c078a

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.8.1 (28 August 2023)
2+
3+
- Fixes a bug where servicing equipment waiting for the next operational period at the end of a simulation get stuck in an infinite loop because the timeout is set for just prior to the end of the simulation, and not just after the end of the simulation's maximum run time.
4+
15
## v0.8.0 (16 August 2023)
26

37
### Bug Fixes

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
}
9696

9797
# toggle this between auto/off to rerun full documentation build
98-
nb_execution_mode = "off"
98+
nb_execution_mode = "auto"
9999
nb_execution_timeout = -1
100100
nb_execution_allow_errors = True
101101
# nb_execution_excludepatterns.append("*_demonstration.md")

wombat/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from wombat.core.library import create_library_structure
55

66

7-
__version__ = "0.8.0"
7+
__version__ = "0.8.1"

wombat/core/environment.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def _weather_setup(
418418
weather_file: str,
419419
start_year: int | None = None,
420420
end_year: int | None = None,
421-
) -> pd.DataFrame:
421+
) -> pl.DataFrame:
422422
"""Reads the weather data from the "<inputs>/weather" directory, and creates the
423423
``start_date`` and ``end_date`` time stamps for the simulation.
424424
@@ -476,7 +476,12 @@ def _weather_setup(
476476
.reset_index(drop=False)
477477
)
478478
.with_row_count()
479-
.with_columns((pl.col("datetime").dt.hour()).alias("hour"))
479+
.with_columns(
480+
[
481+
pl.col("datetime").cast(pl.Datetime).dt.cast_time_unit("ns"),
482+
(pl.col("datetime").dt.hour()).alias("hour"),
483+
]
484+
)
480485
)
481486

482487
missing = set(REQUIRED).difference(weather.columns)

wombat/core/service_equipment.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1662,10 +1662,15 @@ def run_unscheduled_in_situ(self) -> Generator[Process, None, None]:
16621662
self.settings.non_operational_dates_set
16631663
)
16641664
if intersection:
1665-
hours_to_next = self.hours_to_next_operational_date(
1666-
start_search_date=max(intersection),
1667-
exclusion_days=mobilization_days,
1668-
)
1665+
intersection_end = max(intersection)
1666+
sim_end = self.env.end_datetime.date()
1667+
if intersection_end != sim_end:
1668+
hours_to_next = self.hours_to_next_operational_date(
1669+
start_search_date=intersection_end,
1670+
exclusion_days=mobilization_days,
1671+
)
1672+
else:
1673+
hours_to_next = self.env.max_run_time - self.env.now
16691674
self.env.log_action(
16701675
agent=self.settings.name,
16711676
action="delay",

0 commit comments

Comments
 (0)