Foreign destination
ForeignDestination
dataclass
Represents an international travel destination with associated infection risk. Uses model: P = 1 - exp(-β_base * R_country * D_stay)
Source code in june/groups/travel/foreign_destination.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
__post_init__()
Load config after initialization
Source code in june/groups/travel/foreign_destination.py
33 34 35 36 37 |
|
calculate_infection_risk(duration_days, travel_purpose=TravelPurpose.BUSINESS)
Calculate infection risk based on destination risk and travel purpose. P = 1 - exp(-β_base * R_country * D_stay)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration_days
|
int
|
Length of stay in days (D_stay) |
required |
travel_purpose
|
TravelPurpose
|
Purpose of travel affecting base transmission rate (Default value = TravelPurpose.BUSINESS) |
BUSINESS
|
Returns:
Type | Description |
---|---|
float
|
Infection probability (0-1) |
Source code in june/groups/travel/foreign_destination.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
ForeignDestinationRegistry
Registry of foreign destinations and their risk levels
Source code in june/groups/travel/foreign_destination.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
get_destination(name)
Get destination by name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
|
required |
Source code in june/groups/travel/foreign_destination.py
105 106 107 108 109 110 111 112 |
|
get_destinations_by_region(region)
Get all destinations in specified region
Parameters:
Name | Type | Description | Default |
---|---|---|---|
region
|
str
|
|
required |
Source code in june/groups/travel/foreign_destination.py
126 127 128 129 130 131 132 133 134 135 136 |
|
get_destinations_by_risk(risk_level)
Get all destinations with specified risk level
Parameters:
Name | Type | Description | Default |
---|---|---|---|
risk_level
|
RiskLevel
|
|
required |
Source code in june/groups/travel/foreign_destination.py
114 115 116 117 118 119 120 121 122 123 124 |
|
RiskLevel
Bases: IntEnum
Source code in june/groups/travel/foreign_destination.py
15 16 17 18 19 |
|
TravelPurpose
Bases: IntEnum
Source code in june/groups/travel/foreign_destination.py
10 11 12 13 |
|