Skip to content

Commit

Permalink
warn when sensor is not of type Sensor
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Garcia Reolid <[email protected]>
  • Loading branch information
victorgarcia98 committed Aug 25, 2023
1 parent e694788 commit af4a773
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions timely_beliefs/beliefs/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,18 @@ def set_columns_and_indices_for_empty_frame(df, columns, indices, default_types)

def assign_sensor_and_event_resolution(df, sensor, event_resolution):
"""Set the Sensor metadata (including timing properties of the sensor)."""


if not isinstance(sensor, Sensor):
import warnings

warnings.warn(
"'sensor' field needs to be of type 'Sensor'. This constraint will be enforced in an upcoming version.",
FutureWarning,
)

# TODO: raise ValueError(...)

df.sensor = sensor
df.event_resolution = (
event_resolution
Expand Down

0 comments on commit af4a773

Please sign in to comment.