Skip to content

feat: added both afp forecast endpoints#565

Merged
Jack-Burge55 merged 6 commits into
masterfrom
rnd-21262
Jun 2, 2026
Merged

feat: added both afp forecast endpoints#565
Jack-Burge55 merged 6 commits into
masterfrom
rnd-21262

Conversation

@Jack-Burge55
Copy link
Copy Markdown
Contributor

@Jack-Burge55 Jack-Burge55 commented May 29, 2026

RELATED TICKETS

! Do not post related PRs here, unless they are open source !

CHANGELOG

  • Added forecast/timeseries and forecast/explanation endpoints to the python sdk

TESTS

  • Added endpoint tests

COMMENTS

Screenshot 2026-06-02 at 14 06 22 Screenshot 2026-06-02 at 14 06 33

Copilot AI review requested due to automatic review settings May 29, 2026 14:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds two new Anywhere Freight Pricing endpoints to the SDK: a forecast time series endpoint (POST, batched route input) and a forecast explanation endpoint (GET, single route with avoid-zone/port-cost options). Both endpoints are wired through the package's public exports, accompanied by integration tests using the real API and "try me out" Binder notebooks.

Changes:

  • New AnywhereFreightPricingForecastTimeseries (POST) and AnywhereFreightPricingForecastExplanation (GET) endpoint classes plus a new AfpExplanationFrequency literal type.
  • Wiring for the new endpoints/types in the SDK __init__ exports, endpoint URL constants, and docs (mkdocs/pydocmd nav + Binder notebooks).
  • Real-API integration tests for both new endpoints covering common parameter combinations.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vortexasdk/endpoints/endpoints.py Adds URL constants for the two new AFP forecast endpoints.
vortexasdk/endpoints/anywhere_freight_pricing_types.py Adds AfpExplanationFrequency literal.
vortexasdk/endpoints/anywhere_freight_pricing_forecast_timeseries.py New POST endpoint wrapper returning AnywhereFreightPricingResult.
vortexasdk/endpoints/anywhere_freight_pricing_forecast_explanation.py New GET endpoint wrapper with optional avoid_zone/include_port_costs.
vortexasdk/endpoints/init.py Re-exports new classes and AfpExplanationFrequency.
vortexasdk/init.py Top-level re-exports for the new symbols.
tests/endpoints/test_anywhere_freight_pricing_forecast_timeseries.py Real-API tests for the timeseries endpoint.
tests/endpoints/test_anywhere_freight_pricing_forecast_explanation.py Real-API tests for the explanation endpoint.
pydocmd.yml Generates docs pages for the new endpoints (uses forecast_explainability.md, inconsistent with module name).
mkdocs.yml Adds nav entries for the new pages (also references forecast_explainability.md).
docs/examples/try_me_out/anywhere_freight_pricing_forecast_timeseries.ipynb New Binder example notebook.
docs/examples/try_me_out/anywhere_freight_pricing_forecast_explanation.ipynb New Binder example notebook.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pydocmd.yml Outdated
Comment thread mkdocs.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (4)

vortexasdk/endpoints/init.py:106

  • AnywhereFreightPricingForecastTimeseries and AnywhereFreightPricingForecastExplanation introduce public method signatures that use AfpForecastRoute / AfpForecastVesselClass, but these types are not re-exported from vortexasdk.endpoints. This makes it harder for SDK users to import the types for annotations in the same way they do for AfpRoute / AfpVesselClass.
from vortexasdk.endpoints.anywhere_freight_pricing_types import (
    AfpAvoidZone,
    AfpExplanationFrequency,
    AfpFrequency,
    AfpProduct,
    AfpRoute,
    AfpUnit,
    AfpVesselClass,
)

vortexasdk/endpoints/init.py:165

  • __all__ is used to document/declare the public surface for type annotations, but it currently omits AfpForecastRoute and AfpForecastVesselClass even though forecast endpoints rely on them. Add them to __all__ to keep exports consistent.
    # AFP types for user type annotations
    "AfpAvoidZone",
    "AfpExplanationFrequency",
    "AfpFrequency",
    "AfpProduct",
    "AfpRoute",
    "AfpUnit",
    "AfpVesselClass",
]

vortexasdk/init.py:60

  • Top-level vortexasdk re-exports AFP types for user annotations, but it does not include AfpForecastRoute / AfpForecastVesselClass even though new forecast endpoints use them in public signatures. Re-export them here for consistency with other AFP types.
    # AFP types
    AfpAvoidZone,
    AfpExplanationFrequency,
    AfpFrequency,
    AfpProduct,
    AfpRoute,
    AfpUnit,
    AfpVesselClass,
)

vortexasdk/init.py:124

  • __all__ in vortexasdk.__init__ similarly omits AfpForecastRoute / AfpForecastVesselClass. If the SDK intends these forecast endpoints to be part of the public API, these types should be included in the declared exports as well.
    # AFP types
    "AfpAvoidZone",
    "AfpExplanationFrequency",
    "AfpFrequency",
    "AfpProduct",
    "AfpRoute",
    "AfpUnit",
    "AfpVesselClass",

Comment thread vortexasdk/endpoints/anywhere_freight_pricing_types.py
Jack-Burge55 and others added 2 commits June 2, 2026 14:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Jack-Burge55 Jack-Burge55 enabled auto-merge (squash) June 2, 2026 15:05
@Jack-Burge55 Jack-Burge55 disabled auto-merge June 2, 2026 15:06
@Jack-Burge55 Jack-Burge55 merged commit 5fa174c into master Jun 2, 2026
11 of 12 checks passed
@Jack-Burge55 Jack-Burge55 deleted the rnd-21262 branch June 2, 2026 15:38
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