openscvx 0.4.1.dev161__tar.gz → 0.4.1.dev163__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/tests-integration.yml +1 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/tests-unit.yml +1 -1
- {openscvx-0.4.1.dev161/openscvx.egg-info → openscvx-0.4.1.dev163}/PKG-INFO +3 -1
- openscvx-0.4.1.dev163/openscvx/__main__.py +103 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/_version.py +3 -3
- openscvx-0.4.1.dev163/openscvx/algorithms/__init__.py +180 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/augmented_lagrangian.py +32 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/base.py +1 -2
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/constant_proximal_weight.py +21 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/ramp_proximal_weight.py +22 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/config.py +39 -36
- openscvx-0.4.1.dev163/openscvx/discretization/__init__.py +73 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/discretization/base.py +42 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/expert/byof.py +28 -20
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/expert/lowering.py +18 -18
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/expert/validation.py +48 -103
- openscvx-0.4.1.dev163/openscvx/loader.py +212 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/problem.py +26 -47
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/solvers/__init__.py +14 -45
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/solvers/base.py +30 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/builder.py +4 -4
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/__init__.py +3 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/control.py +33 -2
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/expr.py +0 -44
- openscvx-0.4.1.dev163/openscvx/symbolic/expr/parameter.py +73 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/state.py +54 -2
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/time.py +88 -2
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/variable.py +21 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/vmap.py +2 -2
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lower.py +4 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/expr.py +2 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/expr.py +2 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/parser.py +1 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/preprocessing.py +1 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/utils/caching.py +9 -9
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163/openscvx.egg-info}/PKG-INFO +3 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx.egg-info/SOURCES.txt +1 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx.egg-info/requires.txt +2 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/pyproject.toml +3 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/test_hashing.py +17 -6
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/test_preprocessing.py +3 -1
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_brachistochrone.py +3 -3
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_expert.py +30 -30
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_loader.py +47 -1
- openscvx-0.4.1.dev161/openscvx/__main__.py +0 -54
- openscvx-0.4.1.dev161/openscvx/algorithms/__init__.py +0 -195
- openscvx-0.4.1.dev161/openscvx/discretization/__init__.py +0 -108
- openscvx-0.4.1.dev161/openscvx/loader.py +0 -313
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/assets/logo.svg +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/release-drafter.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/_docs.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/branch-name.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/docs.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/lint.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/nightly.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/release-drafter.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.github/workflows/release.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/.gitignore +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/CONTRIBUTING.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/LICENSE +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/README.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/Foundations/constraint_reformulation.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/Foundations/control_parameterization.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/Foundations/discretization.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/Foundations/ocp.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/Foundations/scvx.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/Foundations/time_dilation.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UnderTheHood/lowering_architecture.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UnderTheHood/vectorization_and_vmapping.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/00_introduction.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/01_hello_world_brachistochrone.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/02_drone_racing_constraints.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/03_obstacle_avoidance_vmap.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/04_viewpoint_constraints.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/05_visualization.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/06_logic.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/07_lie.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/UsersGuide/08_mpcc.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/favicon.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/images/ct-scvx_dark.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/images/ct-scvx_light.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/images/ctcs_dark.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/images/ctcs_light.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/images/problem_class_dark.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/images/problem_class_light.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/assets/logo.svg +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/citation.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/examples.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/getting-started.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/index.md +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/docs/javascripts/mathjax.js +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/abstract/brachistochrone.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/abstract/impulsive.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/abstract/stl_integer_variable.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/abstract/stl_or.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/arm/three_link_arm.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/car/dubins_car.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/car/dubins_car_disjoint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/car/dubins_car_obstacle_conditional.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/car/dubins_car_obstacle_stl.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/car/dubins_car_stl_or.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/car/dubins_car_waypoint_stl.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/cinema_vp.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/dr_double_integrator.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/dr_vp.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/dr_vp_nodal.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/dr_vp_polytope.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/drone_racing.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/logo.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/logo_utils/acl_logo.svg +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/logo_utils/svg_path_utils.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/obstacle_avoidance.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/obstacle_avoidance_nodal.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/drone/obstacle_avoidance_vmap.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/mpc/double_integrator_discrete.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/mpc/double_integrator_drone_racing.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/mpc/dubins_car_circle_analytical.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/mpc/dubins_car_circle_discrete.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/mpc/realtime_double_integrator_drone_racing.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/plotting.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/plotting_viser.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/base_problems/cinema_vp_realtime_base.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/base_problems/drone_racing_realtime_base.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/base_problems/dubins_car_realtime_base.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/base_problems/obstacle_avoidance_realtime_base.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/cinema_vp_realtime.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/drone_racing_realtime.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/dubins_car_realtime.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/realtime/obstacle_avoidance_realtime.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/rocket/3DoF_pdg.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/spacecraft/halo_orbit.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/spacecraft/hohmann_transfer.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/examples/spacecraft/proxops_cw.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/ctlos_cine.gif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/ctlos_dr.gif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/dtlos_cine.gif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/dtlos_dr.gif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/openscvx_logo.svg +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/openscvx_logo_square.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/oscvx_structure_full_dark.svg +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/figures/video_preview.png +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/1-background.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/1-background@1x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/1-background@2x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/1-background@3x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/1-background@4x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/2-mars.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/2-mars@1x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/2-mars@2x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/2-mars@3x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/2-mars@4x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/3-moon.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/3-moon@1x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/3-moon@2x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/3-moon@3x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/3-moon@4x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/4-sat1.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/4-sat1@1x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/4-sat1@2x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/4-sat1@3x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/4-sat1@4x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/5-space.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/5-space@1x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/5-space@2x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/5-space@3x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/5-space@4x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/6-earth.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/6-earth@1x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/6-earth@2x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/6-earth@3x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/images/layers/6-earth@4x.avif +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/javascripts/parallax.js +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/logo.svg +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/stylesheets/custom.css +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/assets/stylesheets/parallax.css +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/home.html +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/main.html +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/partials/parallax/hero.html +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/material/overrides/partials/parallax.html +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/mkdocs.yml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/optimization_results.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/penalized_trust_region.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/weights.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/discretization/discretize_linearize.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/discretization/linearize_discretize.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/discretization/linearize_discretize_sparse.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/discretization/sparse_utils/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/discretization/sparse_utils/bcoo_helpers.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/discretization/sparse_utils/sparse_jacobian.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/expert/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/init/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/init/interpolation.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/integrators/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/integrators/diffrax.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/integrators/runge_kutta.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/cvxpy_constraints.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/cvxpy_variables.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/dynamics.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/jax_constraints.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/parameters.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/problem.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/lowered/unified.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/plotting.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/scp_iteration.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/viser/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/viser/animated.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/viser/orbits.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/viser/plotly_integration.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/viser/primitives.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/viser/scp.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/plotting/viser/server.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/propagation/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/propagation/post_processing.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/propagation/propagation.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/solvers/ptr_solver.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/augmentation.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/constraint_set.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/arithmetic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/array.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/constraint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/lie/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/lie/adjoint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/lie/se3.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/lie/so3.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/linalg.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/logic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/math.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/spatial.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/stl.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/expr/stljax.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/hashing.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/_lowerer.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/_registry.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/arithmetic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/array.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/constraint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/control.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/linalg.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/logic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/math.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/cvxpy/state.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/_lowerer.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/_registry.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/arithmetic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/array.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/constraint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/control.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/lie.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/linalg.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/logic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/math.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/spatial.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/state.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/stl.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/stljax.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/lowerers/jax/vmap.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/_registry.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/array.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/constraint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/lie.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/linalg.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/logic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/math.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/spatial.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/stl.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/stljax.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/parser/tokenizer.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/problem.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/sparsity.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/symbolic/unified.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/utils/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/utils/cache.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/utils/printing.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/utils/profiling.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/utils/utils.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx.egg-info/dependency_links.txt +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx.egg-info/entry_points.txt +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx.egg-info/top_level.txt +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/scripts/gen_example_pages.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/scripts/gen_ref_pages.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/setup.cfg +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/brachistochrone_analytical.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/expr/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/expr/test_gmsr.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/fixtures/brachistochrone.json +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/fixtures/brachistochrone.yaml +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/hohmann_analytical.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_arithmetic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_array.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_constraint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_expr.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_lie.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_linalg.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_logic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_math.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_node_reference.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_parameters.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_scaling.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_spatial.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_stl.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_variable.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/expr/test_vmap.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/__init__.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_array.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_constraint.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_lie.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_linalg.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_load.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_logic.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_math.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_parser.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_spatial.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_stl.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_tokenizer.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/parser/test_vmap.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/test_augmentation.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/test_lower_cvxpy.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/test_lower_jax.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/test_sparsity.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/symbolic/test_unified.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_autotuning.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_cvxpygen_optional.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_discretization.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_examples.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_impulsive.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_init.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_integrators.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_optimization_results.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_plotting.py +0 -0
- {openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/tests/test_propagation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openscvx
|
|
3
|
-
Version: 0.4.1.
|
|
3
|
+
Version: 0.4.1.dev163
|
|
4
4
|
Summary: A general Python-based successive convexification implementation which uses a JAX backend.
|
|
5
5
|
Author-email: Chris Hayner and Griffin Norris <haynec@uw.edu>
|
|
6
6
|
License: Apache Software License
|
|
@@ -22,6 +22,7 @@ Requires-Dist: flatbuffers
|
|
|
22
22
|
Requires-Dist: viser
|
|
23
23
|
Requires-Dist: matplotlib
|
|
24
24
|
Requires-Dist: pyyaml
|
|
25
|
+
Requires-Dist: pydantic>=2.0
|
|
25
26
|
Provides-Extra: gui
|
|
26
27
|
Requires-Dist: pyqtgraph; extra == "gui"
|
|
27
28
|
Requires-Dist: PyQt5; extra == "gui"
|
|
@@ -40,6 +41,7 @@ Requires-Dist: pytest; extra == "test"
|
|
|
40
41
|
Requires-Dist: scipy; extra == "test"
|
|
41
42
|
Requires-Dist: jaxlie; extra == "test"
|
|
42
43
|
Requires-Dist: svgpathtools; extra == "test"
|
|
44
|
+
Requires-Dist: pytest-xdist; extra == "test"
|
|
43
45
|
Dynamic: license-file
|
|
44
46
|
|
|
45
47
|
<a id="readme-top"></a>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""CLI entry point: ``openscvx path/to/problem.yaml``."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _cmd_solve(args):
|
|
10
|
+
"""Solve a trajectory optimization problem from a YAML/JSON file."""
|
|
11
|
+
path: Path = args.config
|
|
12
|
+
if not path.exists():
|
|
13
|
+
print(f"Error: file not found: {path}", file=sys.stderr)
|
|
14
|
+
sys.exit(1)
|
|
15
|
+
|
|
16
|
+
suffix = path.suffix.lower()
|
|
17
|
+
if suffix in (".yaml", ".yml"):
|
|
18
|
+
from openscvx.loader import load_yaml
|
|
19
|
+
|
|
20
|
+
kwargs = load_yaml(path)
|
|
21
|
+
elif suffix == ".json":
|
|
22
|
+
from openscvx.loader import load_json
|
|
23
|
+
|
|
24
|
+
kwargs = load_json(path)
|
|
25
|
+
else:
|
|
26
|
+
print(
|
|
27
|
+
f"Error: unsupported file type {suffix!r} (expected .yaml, .yml, or .json)",
|
|
28
|
+
file=sys.stderr,
|
|
29
|
+
)
|
|
30
|
+
sys.exit(1)
|
|
31
|
+
|
|
32
|
+
from openscvx.problem import Problem
|
|
33
|
+
|
|
34
|
+
settings = kwargs.pop("settings", None)
|
|
35
|
+
problem = Problem(**kwargs)
|
|
36
|
+
if settings:
|
|
37
|
+
problem.settings.apply_dict(settings)
|
|
38
|
+
problem.initialize()
|
|
39
|
+
result = problem.solve()
|
|
40
|
+
result = problem.post_process()
|
|
41
|
+
|
|
42
|
+
if args.output:
|
|
43
|
+
result.save(args.output)
|
|
44
|
+
print(f"Results saved to {args.output}")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _cmd_schema(args):
|
|
48
|
+
"""Generate the JSON Schema for the YAML/JSON problem format."""
|
|
49
|
+
from openscvx.loader import ProblemSpec
|
|
50
|
+
|
|
51
|
+
schema = json.dumps(ProblemSpec.model_json_schema(), indent=2) + "\n"
|
|
52
|
+
|
|
53
|
+
if args.output:
|
|
54
|
+
args.output.write_text(schema)
|
|
55
|
+
print(f"Schema written to {args.output}", file=sys.stderr)
|
|
56
|
+
else:
|
|
57
|
+
sys.stdout.write(schema)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def main():
|
|
61
|
+
# Backwards compat: bare `openscvx path/to/problem.yaml` (no subcommand).
|
|
62
|
+
# Detect this before argparse sees the args, and prepend "solve".
|
|
63
|
+
_SUBCOMMANDS = {"solve", "schema", "-h", "--help"}
|
|
64
|
+
if len(sys.argv) > 1 and sys.argv[1] not in _SUBCOMMANDS:
|
|
65
|
+
sys.argv.insert(1, "solve")
|
|
66
|
+
|
|
67
|
+
parser = argparse.ArgumentParser(
|
|
68
|
+
prog="openscvx",
|
|
69
|
+
description="OpenSCvx trajectory optimization toolkit.",
|
|
70
|
+
)
|
|
71
|
+
subparsers = parser.add_subparsers(dest="command")
|
|
72
|
+
|
|
73
|
+
# --- solve ---
|
|
74
|
+
solve_parser = subparsers.add_parser(
|
|
75
|
+
"solve",
|
|
76
|
+
help="Solve a trajectory optimization problem from a YAML/JSON config file.",
|
|
77
|
+
)
|
|
78
|
+
solve_parser.add_argument(
|
|
79
|
+
"config", type=Path, help="Path to a YAML or JSON problem definition file"
|
|
80
|
+
)
|
|
81
|
+
solve_parser.add_argument("-o", "--output", type=Path, help="Save results to a .npz file")
|
|
82
|
+
solve_parser.set_defaults(func=_cmd_solve)
|
|
83
|
+
|
|
84
|
+
# --- schema ---
|
|
85
|
+
schema_parser = subparsers.add_parser(
|
|
86
|
+
"schema",
|
|
87
|
+
help="Print the JSON Schema for the YAML/JSON problem format.",
|
|
88
|
+
)
|
|
89
|
+
schema_parser.add_argument(
|
|
90
|
+
"-o", "--output", type=Path, help="Write schema to a file instead of stdout"
|
|
91
|
+
)
|
|
92
|
+
schema_parser.set_defaults(func=_cmd_schema)
|
|
93
|
+
|
|
94
|
+
args = parser.parse_args()
|
|
95
|
+
if args.command is None:
|
|
96
|
+
parser.print_help()
|
|
97
|
+
sys.exit(1)
|
|
98
|
+
|
|
99
|
+
args.func(args)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
if __name__ == "__main__":
|
|
103
|
+
main()
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.4.1.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 4, 1, '
|
|
21
|
+
__version__ = version = '0.4.1.dev163'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 4, 1, 'dev163')
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g18f7230f1'
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"""Successive convexification algorithms for trajectory optimization.
|
|
2
|
+
|
|
3
|
+
This module provides implementations of SCvx (Successive Convexification) algorithms
|
|
4
|
+
for solving non-convex trajectory optimization problems through iterative convex
|
|
5
|
+
approximation.
|
|
6
|
+
|
|
7
|
+
All algorithms inherit from :class:`Algorithm`, enabling pluggable algorithm
|
|
8
|
+
implementations and custom SCvx variants:
|
|
9
|
+
|
|
10
|
+
```python
|
|
11
|
+
class Algorithm(ABC):
|
|
12
|
+
@abstractmethod
|
|
13
|
+
def initialize(self, solver, discretization_solver, jax_constraints,
|
|
14
|
+
emitter, params, settings) -> None:
|
|
15
|
+
'''Store compiled infrastructure and warm-start solvers.'''
|
|
16
|
+
...
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def step(self, state, params, settings) -> bool:
|
|
20
|
+
'''Execute one iteration using stored infrastructure.'''
|
|
21
|
+
...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Immutable components (solver, discretization_solver, jax_constraints, etc.) are stored
|
|
25
|
+
during ``initialize()``. Mutable configuration (params, settings) is passed per-step
|
|
26
|
+
to support runtime parameter updates and tolerance tuning.
|
|
27
|
+
|
|
28
|
+
:class:`AlgorithmState` holds mutable state during SCP iterations. Algorithms
|
|
29
|
+
that require additional state can subclass it:
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
@dataclass
|
|
33
|
+
class MyAlgorithmState(AlgorithmState):
|
|
34
|
+
my_custom_field: float = 0.0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Note:
|
|
38
|
+
``AlgorithmState`` currently combines iteration metrics (costs, weights),
|
|
39
|
+
trajectory history, and discretization data. A future refactor may separate
|
|
40
|
+
these concerns into distinct classes for clearer data flow:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
@dataclass
|
|
44
|
+
class AlgorithmState:
|
|
45
|
+
# Mutable iteration state
|
|
46
|
+
k: int
|
|
47
|
+
J_tr: float
|
|
48
|
+
J_vb: float
|
|
49
|
+
J_vc: float
|
|
50
|
+
lam_prox: float
|
|
51
|
+
lam_cost: float
|
|
52
|
+
lam_vc: ...
|
|
53
|
+
lam_vb_nodal: np.ndarray # (N, n_nodal)
|
|
54
|
+
lam_vb_cross: np.ndarray # (n_cross,)
|
|
55
|
+
|
|
56
|
+
@dataclass
|
|
57
|
+
class TrajectoryHistory:
|
|
58
|
+
# Accumulated trajectory solutions
|
|
59
|
+
X: List[np.ndarray]
|
|
60
|
+
U: List[np.ndarray]
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def x(self): return self.X[-1]
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def u(self): return self.U[-1]
|
|
67
|
+
|
|
68
|
+
@dataclass
|
|
69
|
+
class DebugHistory:
|
|
70
|
+
# Optional diagnostic data (discretization matrices, etc.)
|
|
71
|
+
V_history: List[np.ndarray]
|
|
72
|
+
VC_history: List[np.ndarray]
|
|
73
|
+
TR_history: List[np.ndarray]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Current Implementations:
|
|
77
|
+
|
|
78
|
+
- :class:`PenalizedTrustRegion`: Penalized Trust Region (PTR) algorithm
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
from typing import Annotated, Any, Dict, List, Optional, Union
|
|
82
|
+
|
|
83
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
84
|
+
|
|
85
|
+
from .augmented_lagrangian import AugmentedLagrangian, AugmentedLagrangianSpec
|
|
86
|
+
from .base import Algorithm, AlgorithmState, AutotuningBase, DiscretizationResult
|
|
87
|
+
from .constant_proximal_weight import ConstantProximalWeight, ConstantProximalWeightSpec
|
|
88
|
+
from .optimization_results import OptimizationResults
|
|
89
|
+
from .penalized_trust_region import PenalizedTrustRegion
|
|
90
|
+
from .ramp_proximal_weight import RampProximalWeight, RampProximalWeightSpec
|
|
91
|
+
from .weights import Weights
|
|
92
|
+
|
|
93
|
+
# ---------------------------------------------------------------------------
|
|
94
|
+
# Autotuner config — discriminated union of each autotuner's Spec
|
|
95
|
+
# ---------------------------------------------------------------------------
|
|
96
|
+
|
|
97
|
+
AutotunerConfig = Annotated[
|
|
98
|
+
Union[
|
|
99
|
+
AugmentedLagrangianSpec,
|
|
100
|
+
RampProximalWeightSpec,
|
|
101
|
+
ConstantProximalWeightSpec,
|
|
102
|
+
],
|
|
103
|
+
Field(discriminator="type"),
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
# ---------------------------------------------------------------------------
|
|
107
|
+
# Algorithm config model
|
|
108
|
+
# ---------------------------------------------------------------------------
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class PenalizedTrustRegionConfig(BaseModel):
|
|
112
|
+
"""Validates PenalizedTrustRegion configuration from dict input.
|
|
113
|
+
|
|
114
|
+
The ``autotuner`` field accepts:
|
|
115
|
+
|
|
116
|
+
* ``None`` — defaults to :class:`AugmentedLagrangian`.
|
|
117
|
+
* A **string** — class name only, default parameters.
|
|
118
|
+
* A **dict** — class name via ``"type"`` key plus overrides.
|
|
119
|
+
* An **instance** — already-constructed autotuner (pass-through).
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
autotuner: Optional[Union[AutotunerConfig, AutotuningBase]] = None
|
|
123
|
+
|
|
124
|
+
@field_validator("autotuner", mode="before")
|
|
125
|
+
@classmethod
|
|
126
|
+
def _wrap_bare_string(cls, v: Any) -> Any:
|
|
127
|
+
if isinstance(v, str):
|
|
128
|
+
return {"type": v}
|
|
129
|
+
return v
|
|
130
|
+
|
|
131
|
+
k_max: int = 200
|
|
132
|
+
lam_prox: Union[float, Dict[str, Any]] = 1e-1
|
|
133
|
+
lam_vc: Union[float, Dict[str, Any]] = 1e0
|
|
134
|
+
lam_cost: Union[float, Dict[str, Any]] = 1e-2
|
|
135
|
+
lam_vb: float = 0.0
|
|
136
|
+
ep_tr: float = 1e-4
|
|
137
|
+
ep_vb: float = 1e-4
|
|
138
|
+
ep_vc: float = 1e-8
|
|
139
|
+
|
|
140
|
+
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
|
141
|
+
|
|
142
|
+
def to_algorithm(
|
|
143
|
+
self,
|
|
144
|
+
states: Optional[List[Any]] = None,
|
|
145
|
+
controls: Optional[List[Any]] = None,
|
|
146
|
+
) -> PenalizedTrustRegion:
|
|
147
|
+
at = self.autotuner
|
|
148
|
+
if at is None:
|
|
149
|
+
autotuner = None
|
|
150
|
+
elif isinstance(at, AutotuningBase):
|
|
151
|
+
autotuner = at
|
|
152
|
+
else:
|
|
153
|
+
autotuner = at.build()
|
|
154
|
+
kwargs = self.model_dump(exclude={"autotuner"}, exclude_unset=True)
|
|
155
|
+
return PenalizedTrustRegion(
|
|
156
|
+
autotuner=autotuner,
|
|
157
|
+
states=states,
|
|
158
|
+
controls=controls,
|
|
159
|
+
**kwargs,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
__all__ = [
|
|
164
|
+
# Base class
|
|
165
|
+
"Algorithm",
|
|
166
|
+
"AlgorithmState",
|
|
167
|
+
"DiscretizationResult",
|
|
168
|
+
"Weights",
|
|
169
|
+
# Core results
|
|
170
|
+
"OptimizationResults",
|
|
171
|
+
# PTR algorithm
|
|
172
|
+
"PenalizedTrustRegion",
|
|
173
|
+
"AutotuningBase",
|
|
174
|
+
"AugmentedLagrangian",
|
|
175
|
+
"ConstantProximalWeight",
|
|
176
|
+
"RampProximalWeight",
|
|
177
|
+
# Config models
|
|
178
|
+
"PenalizedTrustRegionConfig",
|
|
179
|
+
"AutotunerConfig",
|
|
180
|
+
]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"""Autotuning functions for SCP (Successive Convex Programming) parameters."""
|
|
2
2
|
|
|
3
3
|
from copy import deepcopy
|
|
4
|
-
from typing import TYPE_CHECKING, List
|
|
4
|
+
from typing import TYPE_CHECKING, List, Literal
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
|
+
from pydantic import BaseModel, ConfigDict
|
|
7
8
|
|
|
8
9
|
from openscvx.config import Config
|
|
9
10
|
from openscvx.utils.printing import (
|
|
@@ -364,3 +365,33 @@ class AugmentedLagrangian(AutotuningBase):
|
|
|
364
365
|
adaptive_state = "Initial"
|
|
365
366
|
|
|
366
367
|
return adaptive_state
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
# =============================================================================
|
|
371
|
+
# Pydantic spec for dict / YAML validation
|
|
372
|
+
# =============================================================================
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
class AugmentedLagrangianSpec(BaseModel):
|
|
376
|
+
"""Validates AugmentedLagrangian configuration from dict/YAML input."""
|
|
377
|
+
|
|
378
|
+
type: Literal["AugmentedLagrangian"] = "AugmentedLagrangian"
|
|
379
|
+
rho_init: float = 1.0
|
|
380
|
+
rho_max: float = 1e2
|
|
381
|
+
gamma_1: float = 2.0
|
|
382
|
+
gamma_2: float = 0.5
|
|
383
|
+
eta_0: float = 1e-2
|
|
384
|
+
eta_1: float = 1e-1
|
|
385
|
+
eta_2: float = 0.8
|
|
386
|
+
ep: float = 0.99
|
|
387
|
+
eta_lambda: float = 1e1
|
|
388
|
+
lam_vc_max: float = 1e5
|
|
389
|
+
lam_prox_min: float = 1e-3
|
|
390
|
+
lam_prox_max: float = 1e4
|
|
391
|
+
lam_cost_drop: int = -1
|
|
392
|
+
lam_cost_relax: float = 1.0
|
|
393
|
+
|
|
394
|
+
model_config = ConfigDict(extra="forbid")
|
|
395
|
+
|
|
396
|
+
def build(self) -> AugmentedLagrangian:
|
|
397
|
+
return AugmentedLagrangian(**self.model_dump(exclude={"type"}, exclude_unset=True))
|
|
@@ -119,8 +119,7 @@ class AutotuningBase(ABC):
|
|
|
119
119
|
that are shared across different autotuning strategies (e.g., Penalized Trust
|
|
120
120
|
Region, Augmented Lagrangian).
|
|
121
121
|
|
|
122
|
-
Subclasses
|
|
123
|
-
weight update strategy.
|
|
122
|
+
Subclasses must implement the ``update_weights`` method.
|
|
124
123
|
|
|
125
124
|
Class Attributes:
|
|
126
125
|
COLUMNS: List of Column specs for autotuner-specific metrics to display.
|
{openscvx-0.4.1.dev161 → openscvx-0.4.1.dev163}/openscvx/algorithms/constant_proximal_weight.py
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Autotuning functions for SCP (Successive Convex Programming) parameters."""
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
3
|
+
from typing import TYPE_CHECKING, Literal
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
4
6
|
|
|
5
7
|
from openscvx.config import Config
|
|
6
8
|
|
|
@@ -61,3 +63,21 @@ class ConstantProximalWeight(AutotuningBase):
|
|
|
61
63
|
candidate.lam_prox = state.lam_prox
|
|
62
64
|
state.accept_solution(candidate)
|
|
63
65
|
return "Accept Constant"
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# =============================================================================
|
|
69
|
+
# Pydantic spec for dict / YAML validation
|
|
70
|
+
# =============================================================================
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class ConstantProximalWeightSpec(BaseModel):
|
|
74
|
+
"""Validates ConstantProximalWeight configuration from dict/YAML input."""
|
|
75
|
+
|
|
76
|
+
type: Literal["ConstantProximalWeight"] = "ConstantProximalWeight"
|
|
77
|
+
lam_cost_drop: int = -1
|
|
78
|
+
lam_cost_relax: float = 1.0
|
|
79
|
+
|
|
80
|
+
model_config = ConfigDict(extra="forbid")
|
|
81
|
+
|
|
82
|
+
def build(self) -> ConstantProximalWeight:
|
|
83
|
+
return ConstantProximalWeight(**self.model_dump(exclude={"type"}, exclude_unset=True))
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""Autotuning functions for SCP (Successive Convex Programming) parameters."""
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
3
|
+
from typing import TYPE_CHECKING, Literal
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
|
+
from pydantic import BaseModel, ConfigDict
|
|
6
7
|
|
|
7
8
|
from openscvx.config import Config
|
|
8
9
|
|
|
@@ -77,3 +78,23 @@ class RampProximalWeight(AutotuningBase):
|
|
|
77
78
|
else:
|
|
78
79
|
state.accept_solution(candidate)
|
|
79
80
|
return "Accept Higher"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# =============================================================================
|
|
84
|
+
# Pydantic spec for dict / YAML validation
|
|
85
|
+
# =============================================================================
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class RampProximalWeightSpec(BaseModel):
|
|
89
|
+
"""Validates RampProximalWeight configuration from dict/YAML input."""
|
|
90
|
+
|
|
91
|
+
type: Literal["RampProximalWeight"] = "RampProximalWeight"
|
|
92
|
+
ramp_factor: float = 1.0
|
|
93
|
+
lam_prox_max: float = 1e3
|
|
94
|
+
lam_cost_drop: int = -1
|
|
95
|
+
lam_cost_relax: float = 1.0
|
|
96
|
+
|
|
97
|
+
model_config = ConfigDict(extra="forbid")
|
|
98
|
+
|
|
99
|
+
def build(self) -> RampProximalWeight:
|
|
100
|
+
return RampProximalWeight(**self.model_dump(exclude={"type"}, exclude_unset=True))
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from typing import Optional
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Any, ClassVar, Dict, Optional
|
|
3
3
|
|
|
4
4
|
import numpy as np
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
5
6
|
|
|
6
7
|
from openscvx.lowered.unified import UnifiedControl, UnifiedState
|
|
7
8
|
|
|
@@ -12,14 +13,13 @@ def get_affine_scaling_matrices(n, minimum, maximum):
|
|
|
12
13
|
return S, c
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
class DevConfig:
|
|
16
|
+
class DevConfig(BaseModel):
|
|
17
17
|
"""Configuration class for development settings.
|
|
18
18
|
|
|
19
19
|
This class defines the parameters used for development and debugging
|
|
20
20
|
purposes.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Attributes:
|
|
23
23
|
profiling: Whether to enable profiling for performance
|
|
24
24
|
analysis. Defaults to False.
|
|
25
25
|
debug: Disables all precompilation so you can place
|
|
@@ -37,15 +37,16 @@ class DevConfig:
|
|
|
37
37
|
printing: bool = True
|
|
38
38
|
verbosity: int = 2
|
|
39
39
|
|
|
40
|
+
model_config = ConfigDict(extra="forbid")
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
class PropagationConfig:
|
|
42
|
+
|
|
43
|
+
class PropagationConfig(BaseModel):
|
|
43
44
|
"""Configuration class for propagation settings.
|
|
44
45
|
|
|
45
46
|
This class defines the parameters required for propagating the nonlinear
|
|
46
47
|
system dynamics using the optimal control sequence.
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
Attributes:
|
|
49
50
|
inter_sample: How dense the propagation within multishot
|
|
50
51
|
discretization should be. Defaults to 30.
|
|
51
52
|
dt: The time step for propagation. Defaults to 0.01.
|
|
@@ -63,10 +64,21 @@ class PropagationConfig:
|
|
|
63
64
|
dt: float = 0.01
|
|
64
65
|
solver: str = "Dopri8"
|
|
65
66
|
max_tau_len: int = 1000
|
|
66
|
-
args:
|
|
67
|
+
args: Dict[str, Any] = {}
|
|
67
68
|
atol: float = 1e-3
|
|
68
69
|
rtol: float = 1e-6
|
|
69
70
|
|
|
71
|
+
model_config = ConfigDict(extra="forbid")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class SettingsSpec(BaseModel):
|
|
75
|
+
"""Validates the ``settings:`` block from YAML/JSON input."""
|
|
76
|
+
|
|
77
|
+
dev: Optional[DevConfig] = None
|
|
78
|
+
prp: Optional[PropagationConfig] = None
|
|
79
|
+
|
|
80
|
+
model_config = ConfigDict(extra="forbid")
|
|
81
|
+
|
|
70
82
|
|
|
71
83
|
@dataclass(init=False)
|
|
72
84
|
class SimConfig:
|
|
@@ -224,7 +236,13 @@ class Config:
|
|
|
224
236
|
dev: DevConfig
|
|
225
237
|
|
|
226
238
|
# Subsections derived from the lowered problem — not user-configurable.
|
|
227
|
-
_INTERNAL_FIELDS = frozenset({"sim"})
|
|
239
|
+
_INTERNAL_FIELDS: ClassVar[frozenset] = frozenset({"sim"})
|
|
240
|
+
|
|
241
|
+
# Maps configurable section names to their pydantic model classes.
|
|
242
|
+
_SECTION_MODELS: ClassVar[Dict[str, type]] = {
|
|
243
|
+
"prp": PropagationConfig,
|
|
244
|
+
"dev": DevConfig,
|
|
245
|
+
}
|
|
228
246
|
|
|
229
247
|
def apply_dict(self, settings: dict) -> None:
|
|
230
248
|
"""Apply a nested settings dict to this :class:`Config`.
|
|
@@ -232,25 +250,23 @@ class Config:
|
|
|
232
250
|
Valid subsection names are discovered automatically from the
|
|
233
251
|
dataclass fields (minus internal ones like ``sim``).
|
|
234
252
|
|
|
253
|
+
Each subsection is validated through its pydantic model, so
|
|
254
|
+
typos and wrong types are caught immediately (``extra="forbid"``).
|
|
255
|
+
|
|
235
256
|
Example::
|
|
236
257
|
|
|
237
258
|
config.apply_dict({
|
|
238
259
|
"dev": {"printing": False, "verbosity": 1},
|
|
239
260
|
})
|
|
240
261
|
|
|
241
|
-
Dict values are handled contextually:
|
|
242
|
-
|
|
243
|
-
* If the target attribute is itself a ``dict`` (e.g.
|
|
244
|
-
``solver_args``), the incoming dict **replaces** it.
|
|
245
|
-
* Otherwise the incoming dict **recurses** into the sub-object.
|
|
246
|
-
|
|
247
262
|
Args:
|
|
248
263
|
settings: ``{section: {key: value, ...}, ...}``
|
|
249
264
|
|
|
250
265
|
Raises:
|
|
251
|
-
ValueError: On unknown section names
|
|
266
|
+
ValueError: On unknown section names.
|
|
267
|
+
ValidationError: On unknown keys or wrong types within a section.
|
|
252
268
|
"""
|
|
253
|
-
configurable =
|
|
269
|
+
configurable = set(self._SECTION_MODELS)
|
|
254
270
|
|
|
255
271
|
for section, values in settings.items():
|
|
256
272
|
if section not in configurable:
|
|
@@ -261,21 +277,8 @@ class Config:
|
|
|
261
277
|
raise ValueError(
|
|
262
278
|
f"Expected a mapping for settings.{section}, got {type(values).__name__}"
|
|
263
279
|
)
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
* Plain values → ``setattr``.
|
|
271
|
-
* Dict values where the current attribute is a ``dict`` → ``setattr``
|
|
272
|
-
(replacement, e.g. ``solver_args``).
|
|
273
|
-
* Dict values where the current attribute is an object → recurse.
|
|
274
|
-
"""
|
|
275
|
-
for key, val in values.items():
|
|
276
|
-
if not hasattr(obj, key):
|
|
277
|
-
raise ValueError(f"Unknown setting '{prefix}.{key}'")
|
|
278
|
-
if isinstance(val, dict) and not isinstance(getattr(obj, key), dict):
|
|
279
|
-
_apply_dict_to(getattr(obj, key), val, prefix=f"{prefix}.{key}")
|
|
280
|
-
else:
|
|
281
|
-
setattr(obj, key, val)
|
|
280
|
+
# Merge current values with overrides and re-validate through pydantic.
|
|
281
|
+
current = getattr(self, section)
|
|
282
|
+
model_cls = self._SECTION_MODELS[section]
|
|
283
|
+
updated = model_cls.model_validate({**current.model_dump(), **values})
|
|
284
|
+
setattr(self, section, updated)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"""Discretization methods for trajectory optimization.
|
|
2
|
+
|
|
3
|
+
This module provides implementations of discretization schemes that convert
|
|
4
|
+
continuous-time optimal control problems into discrete-time approximations
|
|
5
|
+
suitable for numerical optimization.
|
|
6
|
+
|
|
7
|
+
Discretization and linearization are combined into a single interface
|
|
8
|
+
(:class:`Discretizer`) because different schemes may linearize then discretize,
|
|
9
|
+
discretize then linearize, or use other approaches. The ordering changes the
|
|
10
|
+
intermediate types, but the input (continuous nonlinear dynamics + reference
|
|
11
|
+
trajectory) and output (discrete-time linear matrices A_d, B_d, C_d) are
|
|
12
|
+
always consistent.
|
|
13
|
+
|
|
14
|
+
:class:`Problem` uses :class:`LinearizeDiscretizeSparse` by default (sparse
|
|
15
|
+
Jacobians and compact variational integration when sparsity patterns exist).
|
|
16
|
+
:class:`LinearizeDiscretize` is the dense linearize-then-discretize scheme.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
21
|
+
from .base import _DISCRETIZER_MAP, Discretizer, DiscretizerSpec, DisType
|
|
22
|
+
from .discretize_linearize import DiscretizeLinearizeVectorize, VectorizeDiscretizeLinearize
|
|
23
|
+
from .linearize_discretize import (
|
|
24
|
+
LinearizeDiscretize,
|
|
25
|
+
calculate_impulsive_discretization,
|
|
26
|
+
get_impulsive_discretization_solver,
|
|
27
|
+
)
|
|
28
|
+
from .linearize_discretize_sparse import LinearizeDiscretizeSparse
|
|
29
|
+
from .sparse_utils import color_columns, make_sparse_jacobian_fns
|
|
30
|
+
|
|
31
|
+
# ---------------------------------------------------------------------------
|
|
32
|
+
# Populate the discretizer class map now that all classes are imported
|
|
33
|
+
# ---------------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
_DISCRETIZER_MAP.update(
|
|
36
|
+
{
|
|
37
|
+
"VectorizeDiscretizeLinearize": VectorizeDiscretizeLinearize,
|
|
38
|
+
"DiscretizeLinearizeVectorize": DiscretizeLinearizeVectorize,
|
|
39
|
+
"LinearizeDiscretize": LinearizeDiscretize,
|
|
40
|
+
"LinearizeDiscretizeSparse": LinearizeDiscretizeSparse,
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
DEFAULT_DISCRETIZER_TYPE = "VectorizeDiscretizeLinearize"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def resolve_discretizer_config(val: Any) -> DiscretizerSpec:
|
|
48
|
+
"""Validate a dict/Spec into a :class:`DiscretizerSpec` instance.
|
|
49
|
+
|
|
50
|
+
Injects the default ``type`` (``VectorizeDiscretizeLinearize``) when the
|
|
51
|
+
input dict omits it, preserving backwards compatibility.
|
|
52
|
+
"""
|
|
53
|
+
if isinstance(val, DiscretizerSpec):
|
|
54
|
+
return val
|
|
55
|
+
if isinstance(val, dict) and "type" not in val:
|
|
56
|
+
val = {**val, "type": DEFAULT_DISCRETIZER_TYPE}
|
|
57
|
+
return DiscretizerSpec.model_validate(val)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
__all__ = [
|
|
61
|
+
"DisType",
|
|
62
|
+
"Discretizer",
|
|
63
|
+
"DiscretizerSpec",
|
|
64
|
+
"DiscretizeLinearizeVectorize",
|
|
65
|
+
"LinearizeDiscretize",
|
|
66
|
+
"LinearizeDiscretizeSparse",
|
|
67
|
+
"VectorizeDiscretizeLinearize",
|
|
68
|
+
"resolve_discretizer_config",
|
|
69
|
+
"calculate_impulsive_discretization",
|
|
70
|
+
"color_columns",
|
|
71
|
+
"get_impulsive_discretization_solver",
|
|
72
|
+
"make_sparse_jacobian_fns",
|
|
73
|
+
]
|