-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautogenerated_vessel_list.py
More file actions
42 lines (36 loc) · 1.35 KB
/
autogenerated_vessel_list.py
File metadata and controls
42 lines (36 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""This file contains the AutogeneratedVesselList class,
which merely stores the parameters for an AutogeneratedVesselList
Classes:
AutogeneratedVesselList
"""
class AutogeneratedVesselList:
"""This class stores the data for the summary.txt file.
Attributes:
nation_codes: list[str]
always_include_years: list[int]
loadout_include_years: list[int]
always_include_vessels: list[str]
never_include_vessels: list[str]
Methods:
None
"""
def __init__(self, autogenerated_vessel_list_line: str) -> None:
autogenerated_vessel_list_line.strip()
try:
self.nation_codes = autogenerated_vessel_list_line.split("|")[0].split(",")
self.always_include_years = [
int(year)
for year in autogenerated_vessel_list_line.split("|")[1].split(",")
]
self.loadout_include_years = [
int(year) if year != "" else None
for year in autogenerated_vessel_list_line.split("|")[2].split(",")
]
self.always_include_vessels = autogenerated_vessel_list_line.split("|")[
3
].split(",")
self.never_include_vessels = autogenerated_vessel_list_line.split("|")[
4
].split(",")
except IndexError:
pass