Skip to content

Commit

Permalink
Merge pull request #107 from WISDEM/develop
Browse files Browse the repository at this point in the history
v0.8.1
  • Loading branch information
RHammond2 authored Aug 28, 2023
2 parents ed3b184 + 45a37e7 commit d3c078a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.8.1 (28 August 2023)

- 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.

## v0.8.0 (16 August 2023)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}

# toggle this between auto/off to rerun full documentation build
nb_execution_mode = "off"
nb_execution_mode = "auto"
nb_execution_timeout = -1
nb_execution_allow_errors = True
# nb_execution_excludepatterns.append("*_demonstration.md")
Expand Down
2 changes: 1 addition & 1 deletion wombat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from wombat.core.library import create_library_structure


__version__ = "0.8.0"
__version__ = "0.8.1"
9 changes: 7 additions & 2 deletions wombat/core/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def _weather_setup(
weather_file: str,
start_year: int | None = None,
end_year: int | None = None,
) -> pd.DataFrame:
) -> pl.DataFrame:
"""Reads the weather data from the "<inputs>/weather" directory, and creates the
``start_date`` and ``end_date`` time stamps for the simulation.
Expand Down Expand Up @@ -476,7 +476,12 @@ def _weather_setup(
.reset_index(drop=False)
)
.with_row_count()
.with_columns((pl.col("datetime").dt.hour()).alias("hour"))
.with_columns(
[
pl.col("datetime").cast(pl.Datetime).dt.cast_time_unit("ns"),
(pl.col("datetime").dt.hour()).alias("hour"),
]
)
)

missing = set(REQUIRED).difference(weather.columns)
Expand Down
13 changes: 9 additions & 4 deletions wombat/core/service_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1662,10 +1662,15 @@ def run_unscheduled_in_situ(self) -> Generator[Process, None, None]:
self.settings.non_operational_dates_set
)
if intersection:
hours_to_next = self.hours_to_next_operational_date(
start_search_date=max(intersection),
exclusion_days=mobilization_days,
)
intersection_end = max(intersection)
sim_end = self.env.end_datetime.date()
if intersection_end != sim_end:
hours_to_next = self.hours_to_next_operational_date(
start_search_date=intersection_end,
exclusion_days=mobilization_days,
)
else:
hours_to_next = self.env.max_run_time - self.env.now
self.env.log_action(
agent=self.settings.name,
action="delay",
Expand Down

0 comments on commit d3c078a

Please sign in to comment.