feat: added both afp forecast endpoints#565
Conversation
There was a problem hiding this comment.
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) andAnywhereFreightPricingForecastExplanation(GET) endpoint classes plus a newAfpExplanationFrequencyliteral 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.
There was a problem hiding this comment.
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
AnywhereFreightPricingForecastTimeseriesandAnywhereFreightPricingForecastExplanationintroduce public method signatures that useAfpForecastRoute/AfpForecastVesselClass, but these types are not re-exported fromvortexasdk.endpoints. This makes it harder for SDK users to import the types for annotations in the same way they do forAfpRoute/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 omitsAfpForecastRouteandAfpForecastVesselClasseven 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
vortexasdkre-exports AFP types for user annotations, but it does not includeAfpForecastRoute/AfpForecastVesselClasseven 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__invortexasdk.__init__similarly omitsAfpForecastRoute/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",
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
RELATED TICKETS
! Do not post related PRs here, unless they are open source !
CHANGELOG
TESTS
COMMENTS