Optiframe

Latest version: v0.5.0

Safety actively analyzes 622894 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.5.0

- The abstract classes for each task type and the corresponding attributes for `OptimizationModule`s have been renamed for consistency.
- Instead of overwriting the `.execute` method for all task types, they now provide their own abstract method which indicates the intent of the task.
- The `.mip_construction` (fromerly `.build_mip`) attribute of the `OptimizationModule` is now also optional, just like the others. This is useful if the module can be implemented entirely with pre-processing tasks.

Breaking Changes

- Renamed the task classes for each step:
- `ValidateTask` -> `ValidationTask`
- `BuildMipTask` -> `MipConstructionTask`
- `ExtractSolutionTask` -> `SolutionExtractionTask`
- Instead of overwriting the `.execute()` method for each task type, the task classes now provide dedicated methods that indicate the intent to the task and provide additional documentation:
- `ValidationTask`: `.validate()`
- `PreProcessingTask`: `.pre_process()`
- `MipConstructionTask`: `.construct_mip()`
- `SolutionExtractionTask`: `.extract_solution()`
- Renamed the attributes of the `OptimizationModule` for consistency:
- `.validate` -> `.validation`
- `.build_mip` -> `.mip_construction`
- `.extract_solution` -> `.solution_extraction`
- `Task` is not exported from the `optiframe` root anymore. Instead, use `optiframe.workflow_engine`.

0.4.0

- Renamed `OptimizationPackage` to `OptimizationModule` to better align with the terminology in software engineering. All other usages of `package` have also been replaced by `module`.
- Changed `Optimizer.add_package` to `Optimizer.add_modules`. It can now be used to add multiple modules at the same time.
- Added the `ModelSize.total` property to get the total model size (number of constraints times number of variables).
- Added the `StepTimes.total` property to get the total time needed to solve the problem (the sum of all step times).

Breaking Changes

- `OptimizationPackage` has been renamed to `OptimizationModule`. All other usages of `package` have also been replaced by `module`.
- The `Optimizer.add_package` method has been renamed to `Optimizer.add_modules`. Multiple usages of `.add_package` can also be merged into one `.add_modules` call.

py
before
optimizer.add_package(module_1).add_package(module_2).add_package(module_3)

after
optimizer.add_modules(module_1, module_2, module_3)

0.3.0

- Automatically add metrics to the solution object:
- `ModelSize`, which includes the total number of variables and constraints in the model.
- `StepTimes`, which includes the times needed to execute each step of the optimization process.
- Add convenience solve methods to `InitializedOptimizer`. This makes it easier to start the optimization without executing each step of the process separately.
- Significantly improve the documentation. All public items are now documented.

0.2.0

This release adds a new **pre-processing** step, allowing you to apply optimization techniques to the data.
The `OptimizationPackage` now has a new optional pre processing task to implement functionality for this step.

Breaking Changes

- The `sense` parameter to the `Optimizer` constructor is now required. You can set it to `LpMinimize` or `LpMaximize` to determine if the objective should be minimize or maximized, respectively. This change was made to prevent errors caused by the default value.
- The task of each step now inherits from a separate class each. For example, the `ValidateTask` is the parent class for all tasks in the validate step.
- You need to call `pre_processing()` before `build_mip()` when executing the optimizer to run the new pre-processing step.

0.1.0

This is the first release of **optiframe**, a modular framework for mixed integer programming.

This allows you to keep your mixed integer programs (MIPs) organized, extendable and testable.

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.