Skip to content

feat(rnd-22989): add VoyageCalculator endpoint - #575

Merged
alexspeddingvortexa merged 6 commits into
masterfrom
rnd-22989
Aug 27, 2026
Merged

feat(rnd-22989): add VoyageCalculator endpoint#575
alexspeddingvortexa merged 6 commits into
masterfrom
rnd-22989

Conversation

@alexspeddingvortexa

@alexspeddingvortexa alexspeddingvortexa commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

RELATED TICKETS

CHANGELOG

  • Add VoyageCalculator endpoint class wrapping POST /v5/voyages/voyage-calculator
  • Add VoyageCalculatorResult container with to_list() and to_df() support
  • Export VoyageCalculatorType, VoyageCalculatorVesselStatus, VoyageCalculatorAvoidZone type aliases

TESTS

  • 8 integration tests covering: ETA/ETD/speed calculations, lat/long origins, avoid zones, delay factor, DataFrame output, column filtering
  • Tests hit the real API (skipped in CI via SKIP_TAGS=real)

Run the test suite:

python3 -m pytest tests/endpoints/test_voyage_calculator.py -v

HOW TO TEST THE DEV SDK

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -e .

Note: If you get ModuleNotFoundError: No module named 'packaging', run:

pip install "packaging>=24.0"

This can happen when upgrading an existing venv where the editable install doesn't fully re-resolve transitive deps.

Then in Python:

from vortexasdk import VoyageCalculator

# Calculate ETA: VLCC from Ras Tanura to Rotterdam at 12 knots
ras_tanura = "539db1548407fd97024391d01a6a2be239b1100f070a137d54a79907d03db6c8"
rotterdam = "68faf65af1345067f11dc6723b8da32f00e304a6f33c000118fccd81947deb4e"

result = VoyageCalculator().search(
    type="ETA",
    vessel_status="vessel_status_laden_known",
    origin=ras_tanura,
    destination=rotterdam,
    vessel_class="oil_vlcc",
    ETD="2024-03-01T00:00:00.000Z",
    speed=12,
)
print(result.to_df())

# Using lat/long coordinates with avoid zones
result = VoyageCalculator().search(
    type="ETA",
    vessel_status="vessel_status_laden_known",
    origin={"lat": 26.6, "long": 50.1},
    destination={"lat": 51.9, "long": 4.5},
    vessel_class="oil_vlcc",
    ETD="2024-03-01T00:00:00.000Z",
    speed=12,
    avoid_zone=["Suez Canal"],
)
print(result.to_list())

COMMENTS

  • Mirrors the POST /voyage-calculator endpoint added to adt-voyages-api in #620
  • Uses the response_type="breakdown" path (no pagination) since the endpoint returns at most 1 result
  • Follows the same pattern as AnywhereFreightPricingPostPriceDetails

Implements the Python SDK wrapper for POST /v5/voyages/voyage-calculator,
which calculates voyage routes, ETAs, ETDs, or speeds between an origin
and destination using the pathfinder routing engine.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 15:32
alexspeddingvortexa and others added 2 commits August 26, 2026 16:39
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread vortexasdk/endpoints/voyage_calculator.py Outdated
alexspeddingvortexa and others added 3 commits August 27, 2026 11:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexspeddingvortexa
alexspeddingvortexa merged commit e471ab2 into master Aug 27, 2026
11 of 12 checks passed
@alexspeddingvortexa
alexspeddingvortexa deleted the rnd-22989 branch August 27, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants