diagnostics.py¶
PCR
¶
All symptomatic particles be tested with sensitivity of 90% and a 2 days delay for results.
SEROLOGICAL
¶
All symptomatic particles be tested with sensitivity of 86%.
diagnostic
¶
This class stores the attributes for a disease policy and the methods for its progression.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Name of the diagnostic. |
id |
int |
Id of the diagnostic (same as diag_type). |
filter |
str |
Parsed filter to select particles to diagnose. |
start_day |
int |
Day to start this diagnostic. |
end_day |
int |
Day to end this diagnostic. |
sensitivity |
float |
Sensitivity of the diagnostic (fraction of the positives that it is able to correctly identify). |
specificity |
float |
Specificity of the diagnostic (fraction of the negatives that it is able to correctly identify). |
tests_per_hour |
np.array |
Array with the number of tests to apply in each hour of the day. |
__call__(self)
special
¶
Runs methods related to apply this diagnostic.
__init__(self, diag_param, comm, randgen)
special
¶
Initialize diagnostics object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diag_param |
dict |
Parameters related to the diagnostic. |
required |
comm |
community |
The community object. |
required |
randgen |
Generator |
Random number generator used in diagnostics. |
required |
apply(self)
¶
Apply this diagnostic.
can_be_tested(self)
¶
Returns a mask of the particles that can be tested at the moment.
Returns:
Type | Description |
---|---|
np.array |
Mask of the particles that can be tested at the moment. |
init_diagnostics(parameters, comm)
¶
Initialize diagnostics policies.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters |
dict |
Parameters for the simulation. |
required |
comm |
community |
The community object. |
required |
Returns:
Type | Description |
---|---|
List |
List of the disease objects. |
window_filter(start_state, start_time, end_state, end_time)
¶
Generates a filter to be used in the 'filter_infected' parameter to diagnose in a time window.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_state |
int |
State to mark the start of the window. |
required |
start_time |
float |
Relative time from the transition to the start_state |
required |
end_state |
int |
State to mark the end of the window. |
required |
end_time |
float |
Relative time from the transition to the end_state |
required |
Returns:
Type | Description |
---|---|
tuple |
[description] |