diff --git a/CHANGELOG.md b/CHANGELOG.md index 857a0f93..c696339f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [v2.3.4](https://github.com/simvue-io/python-api/releases/tag/v2.3.4) - 2026-02-10 +## [v2.3.4](https://github.com/simvue-io/python-api/releases/tag/v2.3.4) - 2026-02-11 - Add handling of metrics based on size and enforce 10k points per grid metric as per server. - Freeze `flatdict==4.0.0` do address install issues. diff --git a/CITATION.cff b/CITATION.cff index a93eb4d8..98af5a03 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -43,5 +43,5 @@ keywords: - simulation license: Apache-2.0 commit: a24e113aeb6091399cffa0166dd17d1bae0ed916 -version: 2.3.3 -date-released: '2026-02-10' +version: 2.3.4 +date-released: '2026-02-11' diff --git a/simvue/run.py b/simvue/run.py index 7f587f0b..64fa2ec1 100644 --- a/simvue/run.py +++ b/simvue/run.py @@ -79,6 +79,7 @@ HEARTBEAT_INTERVAL: int = 60 RESOURCES_METRIC_PREFIX: str = "resources" +TOTAL_GRID_METRIC_SIZE: int = 1e6 MAXIMUM_GRID_METRIC_SIZE: int = 5 * 10**4 logger = logging.getLogger(__name__) @@ -547,7 +548,7 @@ def _start(self) -> bool: mode=self._dispatch_mode, termination_trigger=self._shutdown_event, object_types=["events", "metrics_regular", "metrics_tensor"], - thresholds=dict(object_size=MAXIMUM_GRID_METRIC_SIZE), + thresholds=dict(object_size=TOTAL_GRID_METRIC_SIZE), callback=self._create_dispatch_callback(), ) @@ -584,12 +585,6 @@ def _error(self, message: str, join_threads: bool = True) -> None: RuntimeError exception throw """ - # Stop heartbeat - if self._heartbeat_termination_trigger and self._heartbeat_thread: - self._heartbeat_termination_trigger.set() - if join_threads: - self._heartbeat_thread.join() - # Finish stopping all threads if self._shutdown_event: self._shutdown_event.set() @@ -600,6 +595,12 @@ def _error(self, message: str, join_threads: bool = True) -> None: if join_threads: self._dispatcher.join() + # Stop heartbeat + if self._heartbeat_termination_trigger and self._heartbeat_thread: + self._heartbeat_termination_trigger.set() + if join_threads: + self._heartbeat_thread.join() + if not self._suppress_errors: raise SimvueRunError(message) @@ -1860,10 +1861,6 @@ def set_status( def _tidy_run(self) -> None: self._executor.wait_for_completion() - if self._heartbeat_thread and self._heartbeat_termination_trigger: - self._heartbeat_termination_trigger.set() - self._heartbeat_thread.join() - if self._shutdown_event: self._shutdown_event.set() @@ -1876,6 +1873,10 @@ def _tidy_run(self) -> None: self._dispatcher.purge() self._dispatcher.join() + if self._heartbeat_thread and self._heartbeat_termination_trigger: + self._heartbeat_termination_trigger.set() + self._heartbeat_thread.join() + if ( self._sv_obj and self._user_config.run.mode == "offline"