Subject
Description
Default class defining a subject, that can contain multiple sequences. This class can be used in the stats functions to calculate variances across participants.
Initialisation
- class classes.subject.Subject(name=None, group=None, gender=None, age=None)
Creates an instance from the class Subject, and returns a Subject object, which matches one individual that performed one or multiple recordings. Upon creation, a Subject instance contains no Sequence instances. They can be added with the methods
Subject.add_sequence()
,Subject.load_sequence()
orSubject.load_sequences()
.New in version 2.0.
- Parameters:
name (str or None, optional) – The name or identifier of the subject.
group (str or None, optional) – The experimental group the subject belongs to.
gender (str or None, optional) – The gender of the subject (e.g.
"F"```or ``"Female"
).age (int or None, optional) – The age of the subject, in years.
- name
The name or identifier of the subject.
- Type:
str or None
- group
The experimental group the subject belongs to.
- Type:
str or None
- gender
The gender of the subject (e.g.
"F"```or ``"Female"
).- Type:
str or None
- age
The age of the subject, in years.
- Type:
int or None
Note
It is possible to define personalized attributes for subjects if more than one set of conditions is involved. To do so, see
Subject.add_attribute()
.
Setter functions
- Subject.set_name(name)
Sets the attribute
Subject.name
of the Subject instance.New in version 2.0.
- Parameters:
name (str) – The name or identifier of the subject.
- Subject.set_group(group)
Sets the attribute
Subject.group
of the Subject instance.New in version 2.0.
- Parameters:
group (str) – The experimental group the subject belongs to.
- Subject.set_gender(gender)
Sets the attribute
Subject.gender
of the Subject instance.New in version 2.0.
- Parameters:
gender (str) – The gender of the subject (e.g.
"F"```or ``"Female"
).
- Subject.set_age(age)
Sets the attribute
Subject.age
of the Subject instance.New in version 2.0.
- Parameters:
age (int or None) – The age of the subject, in years.
- Subject.set_age_from_dob(day_birth, month_birth, year_birth, day_session=None, month_session=None, year_session=None)
Sets the attribute
Subject.age
of the Subject instance, based on a date of birth and the date of the session. If no session date is provided, the current date is used to calculate the age of the subject. Dates must be provided in the gregorian calendar.New in version 2.0.
- Parameters:
day_birth (int) – The day of birth of the subject, between 1 and 31.
month_birth (int) – The month of birth of the subject, between 1 and 12.
year_birth (int) – The year of birth of the subject.
day_session (int or None) –
The day of the session. If not provided, the current day will be used, e.g.:
month_session (int or None) –
The month of the session. If not provided, the current month will be used, e.g.:
dyear_session (int or None) –
The year of the session. If not provided, the current month will be used, e.g.: