Skip to content

Commit

Permalink
add fallback for onattractorsampler
Browse files Browse the repository at this point in the history
  • Loading branch information
jbial committed Oct 1, 2024
1 parent 70e4b4a commit adaafa0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dysts/sampling.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Sampling functions for dysts"""
"""Example sampling functions for dysts"""

import warnings
from dataclasses import dataclass, field
from typing import Callable, Dict, List, Optional

Expand Down Expand Up @@ -86,9 +87,10 @@ def __call__(self, ic: Array, system: BaseDyn) -> Array:

# if integrate fails, resulting in an incomplete trajectory
if reference_traj is None:
raise ValueError(
warnings.warn(
f"Failed to integrate the system {system.name} with ic {system.ic} and params {system.params}"
)
return ic
else:
self.trajectory_cache[system.name] = reference_traj[
self.reference_traj_transient :
Expand Down

0 comments on commit adaafa0

Please sign in to comment.