Skip to content

Commit

Permalink
#17, Removing MMSI number from the input target ship. Declaring the M…
Browse files Browse the repository at this point in the history
…MSI field optional.
  • Loading branch information
tomarnepedersen committed Jan 25, 2024
1 parent 4d10940 commit 6843adc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions data/target_ships/target_ship_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"width": 20,
"height": 8,
"speedMax": 17,
"mmsi": 257845600,
"name": "BASTO IV",
"name": "BASTO",
"shipType": "Passenger/Ro-Ro Cargo Ship"
}
}
}
3 changes: 1 addition & 2 deletions data/target_ships/target_ship_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"width": 10,
"height": 8,
"speedMax": 15,
"mmsi": 257083180,
"name": "CANOLE",
"shipType": "Cargo"
}
}
}
3 changes: 1 addition & 2 deletions data/target_ships/target_ship_3.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"width": 30,
"height": 30,
"speedMax": 21,
"mmsi": 219945000,
"name": "BASTO VI",
"shipType": "Passenger/Ro-Ro Cargo Ship"
}
}
}
6 changes: 3 additions & 3 deletions src/trafficgen/types.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Domain specific data types used in trafficgen."""

from enum import Enum
from typing import List, Union
from typing import List, Optional, Union
from uuid import UUID

from pydantic import BaseModel
from pydantic import BaseModel, Field


def to_camel(string: str) -> str:
Expand Down Expand Up @@ -99,7 +99,7 @@ class ShipStatic(BaseModel):
width: float
height: float
speed_max: float
mmsi: int
mmsi: Optional[int] = Field(None, ge=100000000, le=999999999, description="Maritime Mobile Service Identity (MMSI)", examples=[123456789])
name: str
ship_type: GeneralShipType

Expand Down

0 comments on commit 6843adc

Please sign in to comment.