june.policy.policy

class june.policy.policy.Policies(policies=None)
__init__(policies=None)

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

classmethod from_file(config_file=PosixPath('/home/sadie/JUNE/configs/defaults/policy/policy.yaml'))
get_policies_for_type(policy_type)
class june.policy.policy.Policy(start_time: Union[str, datetime.datetime] = '1900-01-01', end_time: Union[str, datetime.datetime] = '2100-01-01')

Template for a general policy.

start_time:

date at which to start applying the policy

end_time:

date from which the policy won’t apply

__init__(start_time: Union[str, datetime.datetime] = '1900-01-01', end_time: Union[str, datetime.datetime] = '2100-01-01')

Template for a general policy.

start_time:

date at which to start applying the policy

end_time:

date from which the policy won’t apply

get_spec() → str

Returns the speciailization of the policy.

is_active(date: datetime.datetime) → bool

Returns true if the policy is active, false otherwise

date:

date to check

static read_date(date: Union[str, datetime.datetime]) → datetime.datetime

Read date in two possible formats, either string or datetime.date, both are translated into datetime.datetime to be used by the simulator

date:

date to translate into datetime.datetime

date in datetime format

_abc_impl = <_abc_data object>
class june.policy.policy.PolicyCollection(policies: List[june.policy.policy.Policy])

A collection of like policies active on the same date

__init__(policies: List[june.policy.policy.Policy])

A collection of like policies active on the same date

apply(active_policies)
classmethod from_policies(policies: june.policy.policy.Policies)
get_active(date: <module 'datetime' from '/home/sadie/anaconda3/envs/june/lib/python3.8/datetime.py'>)
june.policy.policy.str_to_class(classname)