School#

class School(scid=None, sc_type=None, school_mixing_type=None, student_uids=array([], dtype=int64), teacher_uids=array([], dtype=int64), non_teaching_staff_uids=array([], dtype=int64), **kwargs)[source]#

Bases: LayerGroup

A class for individual schools and methods to operate on each.

Parameters:

kwargs (dict) – data dictionary of the school

Attributes

member_uids

students, teachers, and non teaching staff.

Methods

validate()[source]#

Check that information supplied to make a school is valid and update to the correct type if necessary.

property member_uids#

students, teachers, and non teaching staff.

Returns:

school member ids

Return type:

np.ndarray

Type:

Return ids of all school members

member_ages(age_by_uid)[source]#

Return ages of all school members: students, teachers, and non teaching staff.

Parameters:

age_by_uid (np.ndarray) – mapping of age to uid

Returns:

school member ages

Return type:

np.ndarray

student_ages(age_by_uid)[source]#

Return student ages in the school.

Parameters:

age_by_uid (np.ndarray) – mapping of age to uid

Returns:

student ages in school

Return type:

np.ndarray

teacher_ages(age_by_uid)[source]#

Return teacher ages in the school.

Parameters:

age_by_uid (np.ndarray) – mapping of age to uid

Returns:

teacher ages in school

Return type:

np.ndarray

non_teaching_staff_ages(age_by_uid)[source]#

Return non-teaching staff ages in the school.

Parameters:

age_by_uid (np.ndarray) – mapping of age to uid

Returns:

non-teaching staff ages in school

Return type:

np.ndarray

get_classroom(clid)[source]#

Return the classroom indexed at clid if school_mixing_type is equal to ‘age_and_class_clustered’.

Parameters:

clid (int) – classroom id number

Returns:

the classroom indexed at clid

Return type:

sp.Classroom