Skip to main content

scipy-optimstruct

Build Status License: MIT

scipy-optimstruct is a Python package that simplifies the implementation of variables and constraints for optimization problems using the SciPy optimization module. It provides a convenient way to define and manage problem structures, making it easier to solve optimization problems.

Features

  • Introduction to Optimization Problem Structures: The package includes a Jupyter notebook that provides an introduction to optimization problem structures and demonstrates how to use the SciPy optimization module to solve optimization problems.

  • Examples of Optimization Problem Structures: The package provides examples of optimization problem structures, including linear programming, quadratic programming, and nonlinear programming.

  • Sample Code: The package includes sample code that demonstrates how to use the optimization problem structures to solve practical problems.

  • Requirements: The package includes a requirements.txt file that lists the required Python packages to run the example code.

Usage

To use scipy-optimstruct, follow these steps:

  1. Install the package using pip:

    pip install scipy-optimstruct
    

Make sure you have the required Python packages installed. You can find the complete list in the requirements.txt file included with the package.


### Sample
import numpy as np
from optimstruct.optim_dict import optim_dict

#initialize optim_dict
my_vars = optim_dict()

#add variables
foo1 = np.array([[1,2,3], [2,4,5], [3,5,7]])
my_vars.add_var("foo1", foo1)

foo2 = np.array([[1,12,3], [2,1,5], [3,55,7]])
my_vars.add_var("foo2", foo2)

#flatten variables into np.array ready to be used with Scipy minimize function
x = my_vars.toVector()

#return np.array into easily accessible dictionary in constrains
var_dict = my_vars.toDict(x)

Release files for scipy-optimstruct 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scipy-optimstruct 0.1.3
File Size Uploaded
scipy_optimstruct-0.1.3.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scipy-optimstruct 0.1.3
File Interpreter ABI Platform
scipy_optimstruct-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / scipy_optimstruct-0.1.3.tar.gz

Download URL scipy_optimstruct-0.1.3.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9d68e194cdb0c2453133d52064b65f213a183d816c43c1bfa2aee8f1d81bea19
BLAKE2b-256 checksum
How to use checksums
629e5b38c38c64dff4d035d3e480dd0b08562add204181f2d410a4e56f70e278
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Release files / scipy_optimstruct-0.1.3-py3-none-any.whl

Download URL scipy_optimstruct-0.1.3-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6aa5ef92c865446afe4330385ac938f22d89af2ef9fa5fa2940dcda530b0de55
BLAKE2b-256 checksum
How to use checksums
26679e4b8de547ea7e5c3f6bc188b9137943fadbcbcee3ba245285d5166895d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page