Subject

class Subject(name: str = 'None')[source]

Bases: object

Represents a subject in the system, holding its data and state.

name

Subject’s name.

Type:

str

tag

RFID tag.

Type:

str

basal_weight

Basal weight.

Type:

float

active

Active days configuration (e.g., “Mon-Fri”, “ON”, “OFF”).

Type:

str

next_session_time

Timestamp for the next allowed session.

Type:

str

next_settings

Next settings JSON string.

Type:

str

subject_series

The raw pandas Series containing subject data.

Type:

pd.Series | None

__init__(name: str = 'None') None[source]

Initializes the Subject.

Parameters:

name (str) – The subject name.

Methods

__init__([name])

Initializes the Subject.

create_from_subject_series([tag])

Populates subject data from the internal pandas Series.

minimum_time_ok()

Checks if the minimum time between sessions has passed.

create_from_subject_series(tag: str = '') bool[source]

Populates subject data from the internal pandas Series.

Parameters:

tag (str) – Optional tag to include in error messages if data is invalid.

Returns:

True if data was successfully loaded, False otherwise.

Return type:

bool

minimum_time_ok() bool[source]

Checks if the minimum time between sessions has passed.

Returns:

True if the subject is allowed to run, False otherwise.

Return type:

bool