Skip to content

Splitting Mesh into EnvironmentMesh and VehicleMesh - #120

Draft
thomaszwagerman wants to merge 58 commits into
mainfrom
dw/mesh_classes
Draft

Splitting Mesh into EnvironmentMesh and VehicleMesh#120
thomaszwagerman wants to merge 58 commits into
mainfrom
dw/mesh_classes

Conversation

@thomaszwagerman

@thomaszwagerman thomaszwagerman commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator

Closes #78, closes #79, closes #80, closes #83, closes #91, closes #119, closes #155, closes #157

Summary of changes:

  • Split instances of Mesh into EnvironmentMesh and VehicleMesh. Mesh has become an abstract class inherited by both.
  • Route requests now require a Vehicle.
  • Mesh ingestion has been adapted to dynamically recognise handle the ingestion of both EnvironmentMesh and VehicleMesh files. If a VehicleMesh is ingested, it will identify the Vehicle and check if it exists in the database, if not it will create it.
  • select_mesh() updated to handle different types of meshes. In first instance search for a VehicleMesh that matches coordinates AND Vehicle. Should this not exists, then find an EnvironmentMesh within coordinates and create a VehicleMesh using supplied vehicle.
  • optimise_route() is now a function which calls PolarRoute's optimisation functionality, not a task. Added add_vehicle_to_environment_mesh function. Task is replaced by a new create_and_calculate_route task which uses these functions to calculate optimal route using VehicleMesh, creating one if necessary.
  • Tests have been adapted (and where appropriate, expanded) to accommodate these changes.
  • Adds vehicle information to route response.
  • Adds vehicle fixtures with SDA, Slocum and BoatyMcBoatFace.
  • Vehicle created by fixture are prevented from being deleted.
  • Enables battery-based vehicles to have their routes optimised for battery use.
  • Changes the route response to return "energy" consumption instead of "fuel", to enable a consistent response for fuel-based and battery-based vehicles.
  • Expands testing suite to cover mesh type ingestion and create_and_calculate_route tasks.
  • PolarRoute 1.0.0 support, >= 1.1.8 required for custom vessel performance functionality.

TO DO:

@thomaszwagerman thomaszwagerman self-assigned this Sep 10, 2025
@thomaszwagerman

Copy link
Copy Markdown
Collaborator Author

All required changes made and previous tests adapted to work, however test coverage is down to 76%.

Probably a bit of effort required in identifying where testing is now lacking with the introduction of a few new mechanics.

@thomaszwagerman

Copy link
Copy Markdown
Collaborator Author

Another round of SIIS integration improvements integrated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment