nost-tools 3.0.0__tar.gz → 3.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nost-tools might be problematic. Click here for more details.
- {nost_tools-3.0.0 → nost_tools-3.0.1}/PKG-INFO +1 -1
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/__init__.py +1 -1
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/managed_application.py +21 -1
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/manager.py +4 -15
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/simulator.py +1 -3
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools.egg-info/PKG-INFO +1 -1
- {nost_tools-3.0.0 → nost_tools-3.0.1}/LICENSE +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/README.md +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/application.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/application_utils.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/configuration.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/entity.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/errors.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/logger_application.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/observer.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/publisher.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools/schemas.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools.egg-info/SOURCES.txt +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools.egg-info/dependency_links.txt +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools.egg-info/requires.txt +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/nost_tools.egg-info/top_level.txt +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/pyproject.toml +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/setup.cfg +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/tests/test_entity.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/tests/test_observer.py +0 -0
- {nost_tools-3.0.0 → nost_tools-3.0.1}/tests/test_simulator.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nost_tools
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.1
|
|
4
4
|
Summary: Tools for Novel Observing Strategies Testbed (NOS-T) Applications
|
|
5
5
|
Author-email: "Paul T. Grogan" <paul.grogan@asu.edu>, "Emmanuel M. Gonzalez" <emmanuelgonzalez@asu.edu>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -324,7 +324,27 @@ class ManagedApplication(Application):
|
|
|
324
324
|
message = body.decode("utf-8")
|
|
325
325
|
params = FreezeCommand.model_validate_json(message).tasking_parameters
|
|
326
326
|
logger.info(f"Received freeze command {message}")
|
|
327
|
-
|
|
327
|
+
|
|
328
|
+
sim_freeze_time = params.sim_freeze_time
|
|
329
|
+
if sim_freeze_time is not None:
|
|
330
|
+
try:
|
|
331
|
+
# Only wait if we haven't reached the requested sim time yet
|
|
332
|
+
if self.simulator.get_time() < sim_freeze_time:
|
|
333
|
+
target_wc = self.simulator.get_wallclock_time_at_simulation_time(sim_freeze_time)
|
|
334
|
+
# Sleep in short intervals to keep responsiveness
|
|
335
|
+
while True:
|
|
336
|
+
now_wc = self.simulator.get_wallclock_time()
|
|
337
|
+
remaining = (target_wc - now_wc).total_seconds()
|
|
338
|
+
if remaining <= 0:
|
|
339
|
+
break
|
|
340
|
+
# Exit early if execution is stopping
|
|
341
|
+
if self.simulator.get_mode() in (Mode.TERMINATING, Mode.TERMINATED):
|
|
342
|
+
return
|
|
343
|
+
time.sleep(min(0.5, max(0.01, remaining)))
|
|
344
|
+
except Exception as e:
|
|
345
|
+
logger.warning(f"Could not align to simFreezeTime={sim_freeze_time}: {e}")
|
|
346
|
+
|
|
347
|
+
# Freeze simulation time
|
|
328
348
|
self.simulator.pause()
|
|
329
349
|
|
|
330
350
|
except Exception as e:
|
|
@@ -757,20 +757,6 @@ class Manager(Application):
|
|
|
757
757
|
)
|
|
758
758
|
return
|
|
759
759
|
|
|
760
|
-
# Compute authoritative resume time
|
|
761
|
-
target_resume_time = base + freeze_duration
|
|
762
|
-
# Optionally honor requested resume_time if it's later than base
|
|
763
|
-
if resume_time is not None and resume_time > base:
|
|
764
|
-
# Keep the earlier of the two if you want to minimize drift across nodes,
|
|
765
|
-
# or the later if you prefer never resuming before a requested time.
|
|
766
|
-
# Here we choose the later to avoid early resume vs. a peer's expectation.
|
|
767
|
-
target_resume_time = max(target_resume_time, resume_time)
|
|
768
|
-
|
|
769
|
-
logger.info(
|
|
770
|
-
f"Resume Time: requested={resume_time} calculated={target_resume_time} "
|
|
771
|
-
f"delta={abs((target_resume_time - (resume_time or target_resume_time)).total_seconds())}s"
|
|
772
|
-
)
|
|
773
|
-
|
|
774
760
|
# Poll until we reach the target, allowing early exit and heartbeats
|
|
775
761
|
while True:
|
|
776
762
|
mode = self.simulator.get_mode()
|
|
@@ -782,8 +768,11 @@ class Manager(Application):
|
|
|
782
768
|
):
|
|
783
769
|
break
|
|
784
770
|
remaining = (
|
|
785
|
-
|
|
771
|
+
resume_time - self.simulator.get_wallclock_time()
|
|
786
772
|
).total_seconds()
|
|
773
|
+
logger.info(
|
|
774
|
+
f"Resume Time: {resume_time} Current Scenario Time: {self.simulator.get_time()} Current Wall Clock Time: {self.simulator.get_wallclock_time()} Remaining time: {remaining}"
|
|
775
|
+
)
|
|
787
776
|
if remaining <= 0:
|
|
788
777
|
break
|
|
789
778
|
self._sleep_with_heartbeat(min(1.0, max(0.01, remaining)))
|
|
@@ -312,8 +312,6 @@ class Simulator(Observable):
|
|
|
312
312
|
self._wallclock_epoch = self.get_wallclock_time()
|
|
313
313
|
self._simulation_epoch = self._time
|
|
314
314
|
self._set_mode(Mode.EXECUTING)
|
|
315
|
-
# Return immediately after resume to avoid waiting
|
|
316
|
-
return
|
|
317
315
|
while (
|
|
318
316
|
self._mode == Mode.EXECUTING
|
|
319
317
|
and self.get_wallclock_time_at_simulation_time(self._next_time)
|
|
@@ -536,7 +534,7 @@ class Simulator(Observable):
|
|
|
536
534
|
"""
|
|
537
535
|
Pauses the scenario execution. Requires that the simulator is in EXECUTING mode.
|
|
538
536
|
"""
|
|
539
|
-
logger.info("Pausing simulation execution.")
|
|
537
|
+
logger.info(f"Pausing simulation execution at {self._time}.")
|
|
540
538
|
if self._mode != Mode.EXECUTING:
|
|
541
539
|
raise RuntimeError("Cannot pause: simulator is not executing.")
|
|
542
540
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nost_tools
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.1
|
|
4
4
|
Summary: Tools for Novel Observing Strategies Testbed (NOS-T) Applications
|
|
5
5
|
Author-email: "Paul T. Grogan" <paul.grogan@asu.edu>, "Emmanuel M. Gonzalez" <emmanuelgonzalez@asu.edu>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|