june.infection.trajectory_maker

class june.infection.trajectory_maker.BetaCompletionTime(a, b, loc=0.0, scale=1.0)
__init__(a, b, loc=0.0, scale=1.0)

Initialize self. See help(type(self)) for accurate signature.

static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
property distribution
class june.infection.trajectory_maker.CompletionTime
static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
class june.infection.trajectory_maker.ConstantCompletionTime(value: float)
__init__(value: float)

Initialize self. See help(type(self)) for accurate signature.

static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
class june.infection.trajectory_maker.DistributionCompletionTime(distribution, *args, **kwargs)
__init__(distribution, *args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
property distribution
class june.infection.trajectory_maker.ExponentialCompletionTime(loc: float, scale)
__init__(loc: float, scale)

Initialize self. See help(type(self)) for accurate signature.

static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
property distribution
class june.infection.trajectory_maker.ExponweibCompletionTime(a, c, loc=0.0, scale=1.0)
__init__(a, c, loc=0.0, scale=1.0)

Initialize self. See help(type(self)) for accurate signature.

static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
property distribution
class june.infection.trajectory_maker.LognormalCompletionTime(s, loc=0.0, scale=1.0)
__init__(s, loc=0.0, scale=1.0)

Initialize self. See help(type(self)) for accurate signature.

static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
property distribution
class june.infection.trajectory_maker.NormalCompletionTime(loc, scale)
__init__(loc, scale)

Initialize self. See help(type(self)) for accurate signature.

static class_for_type(type_string: str) → type

Get a CompletionTime class from a string in configuration

type_string

The type of CompletionTime e.g. constant/exponential/beta

The corresponding class

AssertionError

If the type string is not recognised

classmethod from_dict(variation_type_dict)
_abc_impl = <_abc_data object>
property distribution
class june.infection.trajectory_maker.Stage(*, symptoms_tag: june.infection.symptom_tag.SymptomTag, completion_time: june.infection.trajectory_maker.CompletionTime = <class 'june.infection.trajectory_maker.ConstantCompletionTime'>)

A stage on an illness,

symptoms_tag

What symptoms does the person have at this stage?

completion_time

Function that returns value for how long this stage takes to complete.

__init__(*, symptoms_tag: june.infection.symptom_tag.SymptomTag, completion_time: june.infection.trajectory_maker.CompletionTime = <class 'june.infection.trajectory_maker.ConstantCompletionTime'>)

A stage on an illness,

symptoms_tag

What symptoms does the person have at this stage?

completion_time

Function that returns value for how long this stage takes to complete.

classmethod from_dict(stage_dict)
class june.infection.trajectory_maker.TrajectoryMaker(*stages)

Generate trajectories of a particular kind.

This defines how a given person moves through a series of symptoms.

stages

A list of stages through which the person progresses

__init__(*stages)

Generate trajectories of a particular kind.

This defines how a given person moves through a series of symptoms.

stages

A list of stages through which the person progresses

classmethod from_dict(trajectory_dict)
generate_trajectory() → List[Tuple[float, june.infection.symptom_tag.SymptomTag]]

Generate a trajectory for a person. This is a list of tuples describing what symptoms the person should display at a given time.

property _symptoms_tags
property most_severe_symptoms

The most severe symptoms experienced at any stage in this trajectory

class june.infection.trajectory_maker.TrajectoryMakers(trajectories: List[june.infection.trajectory_maker.TrajectoryMaker])

The various trajectories should depend on external data, and may depend on age & gender of the patient. This would lead to a table of tons of trajectories, with lots of mean values/deviations and an instruction on how to vary them. For this first simple implementation I will choose everything to be fixed (constant)

The trajectories will count “backwards” with zero time being the moment of infection.

Trajectories and their stages should be parsed from configuration. I’ve removed params for now as they weren’t being used but it will be trivial to reintroduce them when we are ready for configurable trajectories.

__init__(trajectories: List[june.infection.trajectory_maker.TrajectoryMaker])

Trajectories and their stages should be parsed from configuration. I’ve removed params for now as they weren’t being used but it will be trivial to reintroduce them when we are ready for configurable trajectories.

classmethod from_file(config_path: str = PosixPath('/home/sadie/JUNE/configs/defaults/symptoms/trajectories.yaml'))june.infection.trajectory_maker.TrajectoryMakers

Currently this doesn’t do what it says it does.

By setting an instance on the class we can make the trajectory maker something like a singleton. However, if it were being loaded from configurations we’d need to be careful as this could give unexpected effects.

classmethod from_list(trajectory_dicts)