Skip to content
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

Add structure to solve optimization problems #4

Merged
merged 26 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3dce891
Added method to convert input variable structure to Opti variables.
S-Dafarra Mar 13, 2023
5235823
Using default_factory in test for CustomInitializationVariable
S-Dafarra Mar 13, 2023
f00f2d7
Added possibility to retrieve the list of variables after they have b…
S-Dafarra Mar 13, 2023
8c462f4
Started implementing a basic optimization problem.
S-Dafarra Mar 15, 2023
9fde714
Renamed solver to a more specific OptimizationSolver.
S-Dafarra Mar 15, 2023
6931629
Added first working test of optimization problem.
S-Dafarra Mar 16, 2023
6fb6701
Using action/checkout v3
S-Dafarra Mar 16, 2023
83f64ae
Added mechanism to fill back the optimization structure when retrievi…
S-Dafarra Mar 17, 2023
a12be92
Added possibility to set guess .
S-Dafarra Mar 17, 2023
3302969
Renamed Variable in ContinuousVariable
S-Dafarra Mar 17, 2023
f888f41
Better use of typing objects
S-Dafarra Mar 17, 2023
3a1daa0
Added possibility to convert expressions from cost to constraints.
S-Dafarra Mar 20, 2023
7fb5256
Improved definition of OptimizationSolver interface.
S-Dafarra Mar 24, 2023
a6f2b06
Added possibility to change the solver in OptimizationProblem
S-Dafarra Mar 24, 2023
c181f0e
Checking the size of the guess fields in OptiSolver.
S-Dafarra Mar 24, 2023
109859c
Added methods to directly add costs and constraints.
S-Dafarra Mar 24, 2023
fd41fc5
Apply suggestions from code review
S-Dafarra Mar 31, 2023
a93f2bb
Avoid to use __dict__
S-Dafarra Mar 31, 2023
06e01fa
Set more output types.
S-Dafarra Mar 31, 2023
26ccb77
Avoid pytest warnings
S-Dafarra Mar 31, 2023
dfdb811
Added custom exception in case the problem has not been solved yet.
S-Dafarra Mar 31, 2023
875bd1a
Using is instead of == when checking the storage type
S-Dafarra Apr 6, 2023
34ba2dd
Using InitVar in optimization problem test
S-Dafarra Apr 6, 2023
57e4a17
Added possibility to set solver options and plugins at construction t…
S-Dafarra Apr 6, 2023
e5614fe
Using an object for the solver output.
S-Dafarra Apr 6, 2023
3310a86
Forced casting to np.array of the opti output.
S-Dafarra Apr 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion src/hippopt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from . import base
from .base.continuous_variable import ContinuousVariable, TContinuousVariable
from .base.opti_solver import OptiSolver
from .base.optimization_object import (
OptimizationObject,
StorageType,
TOptimizationObject,
default_storage_field,
)
from .base.optimization_problem import ExpressionType, OptimizationProblem
from .base.parameter import Parameter, TParameter
from .base.variable import TVariable, Variable
8 changes: 7 additions & 1 deletion src/hippopt/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
from . import optimization_object, parameter, variable
from . import (
continuous_variable,
opti_solver,
optimization_object,
optimization_problem,
parameter,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

from hippopt.base.optimization_object import OptimizationObject

TVariable = TypeVar("TVariable", bound="Variable")
TContinuousVariable = TypeVar("TContinuousVariable", bound="ContinuousVariable")


@dataclasses.dataclass
class Variable(OptimizationObject):
class ContinuousVariable(OptimizationObject):
""""""

StorageType: ClassVar[str] = "variable"
StorageType: ClassVar[str] = "continuous_variable"
StorageTypeMetadata: ClassVar[dict[str, Any]] = dict(StorageType=StorageType)
Loading