Skip to content

Commit

Permalink
Merge pull request #45 from dnv-opensource/44-change-timestep-to-time…
Browse files Browse the repository at this point in the history
…frame-for-better-clarity

44 change timestep to timeframe for better clarity
  • Loading branch information
minhemdnv authored Jun 5, 2024
2 parents cb55e7a + 91b991d commit 8ac071b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Binary file added diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/maritime_schema/types/caga.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ class SimulatedShip(BaseModelConfig):
description="Initial ship heading in degrees",
examples=[45.2],
)
nav_status: AISNavStatus = Field(..., description="AIS Navigational Status")
nav_status: Optional[AISNavStatus] = Field(None, description="AIS Navigational Status")

acceleration: float = Field(None, description="Ship acceleration in `ms^-2`", examples=[0.01])
rate_of_turn: float = Field(None, description="Ship rate of turn in `deg/s`", examples=[1.8])
acceleration: Optional[float] = Field(None, description="Ship acceleration in `ms^-2`", examples=[0.01])
rate_of_turn: Optional[float] = Field(None, description="Ship rate of turn in `deg/s`", examples=[1.8])

model_config = ConfigDict(json_schema_extra={"additionalProperties": True})

Expand Down Expand Up @@ -604,14 +604,14 @@ class CagaData(BaseModelConfig):
)


class SimulationTimeFrame(BaseModelConfig):
class SimulationTimeStep(BaseModelConfig):
time: Union[datetime, int] = Field(
...,
description="Date and Time of the predicted value `ISO 8601` format `YYYY-MM-DDThh:mm:ssZ`",
examples=[datetime.now()],
)
own_ship: SimulatedShip
target_ships: List[SimulatedShip]
target_ships: Optional[List[SimulatedShip]]


class SimulationData(BaseModelConfig):
Expand All @@ -620,7 +620,7 @@ class SimulationData(BaseModelConfig):
description="Simulator software configuration",
examples=[create_software_config_example()],
)
time_series_data: Optional[List[SimulationTimeFrame]] = Field(
time_series_data: Optional[List[SimulationTimeStep]] = Field(
None,
description="TimeSeries data originating from the Simulator",
examples=[
Expand Down
4 changes: 2 additions & 2 deletions src/maritime_schema/types/caga_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ def create_caga_data_example():


def create_simulation_timeframe_example():
from maritime_schema.types.caga import SimulationTimeFrame
from maritime_schema.types.caga import SimulationTimeStep

return SimulationTimeFrame(
return SimulationTimeStep(
time=datetime.now(),
own_ship=create_simulated_ship_example(),
target_ships=[create_simulated_ship_example(), create_simulated_ship_example()],
Expand Down

0 comments on commit 8ac071b

Please sign in to comment.