-
Notifications
You must be signed in to change notification settings - Fork 88
Adjusted python-example to work with pydayntic 2 and fixed problem dataclass to expect a list of options #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Updated the 'objectives' field in the 'Problem' class to accept a list of 'Objective' instead of a list of lists. Removed unnecessary calls to update_forward_refs for various classes.
Removed unnecessary calls to update_forward_refs for Pydantic models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Python interop type definitions to be compatible with Pydantic 2 and fixes the data structure for the objectives field in the Problem class.
- Removed all deprecated
__pydantic_model__.update_forward_refs()calls for Pydantic 2 compatibility - Fixed the
objectivesfield type from nested list to flat list structure - Changes align with the flattening of objectives that occurred in version 1.24.0
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/python-interop/pragmatic_types.py | Removed Pydantic 1 forward reference updates and corrected objectives field type from Optional[List[List[Objective]]] to Optional[List[Objective]] to match the flattened format |
| examples/python-interop/config_types.py | Removed Pydantic 1 forward reference updates for all dataclass definitions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Introduced `minShifts` property in vehicle type schema to enforce minimum shift usage. - Updated fleet generation logic to accommodate minimum shift requirements. - Implemented a new feature to validate minimum shift usage during route planning. - Enhanced goal context creation to include minimum shift features. - Added tests to ensure correct enforcement of minimum shift constraints and their integration with existing features.
…low for breaks with offsets with departure rescheduling
Implement simple way of changing break time windows for offsets to al…
…cles Add even distribution across vehicles
Fixes: #153
This pull request primarily cleans up the Python interop type definition files by removing all calls to
__pydantic_model__.update_forward_refs()and fixes the structure of theobjectivesfield in theProblemclass.Codebase cleanup and simplification:
__pydantic_model__.update_forward_refs()fromconfig_types.pyandpragmatic_types.py, to comply with pydantic 2 and aboveType definition update:
objectivesfield in theProblemclass fromOptional[List[List[Objective]]]toOptional[List[Objective]], fixing the data structure for objectives to work with the vrp_cli.solve_pragmatic method.