Skip to main content

Everest optimization algorithms for Python

Project description

everest-optimizers

The everest-optimizers repository aims to replace the carolina repository by implementing the two algorithms OPTPP_Q_NEWTON and CONMIN_MFD from Dakota. This removes the need of building Dakota through Carolina every time you need to use these two algorithms. Dakota is huge and quite cumbersome to build, so by replacing this dependency we can gain a lot of time.

Note

History starting from 14cb0a7ef00fa56c19f8a3956785b8c6bdbf2cbd and older were filtered to delete all files/folders under dakota-packages except OPTPP.

Getting Started

CONMIN

To call the CONMIN implementation, we go through the python interface that we have made. Both CONMIN and OPTPP should be called using the minimize() function.

Example:

result = minimize(
    fun=obj,
    x0=x0,
    method="conmin_mfd",
    bounds=bounds,
    constraints=constraints,
    options={"ITMAX": 100},
)

Installation

  1. (Optional) We recommend using a virtual enviroment. This can be created and activated by one of the following approaches:
  • Using uv:
uv venv
source .venv/bin/activate
  • Without uv:
python3 -m venv venv
source venv/bin/activate
  1. Install the project:
pip install .[test]

Alternative installation via Docker

Alternatively, you can use Docker to build and run the project with all dependencies:

# Build the Docker image
docker build -t everest-optimizers .

# Run the container to execute tests
docker run everest-optimizers

This approach automatically sets up all required dependencies and runs the tests in an isolated environment.

Tests

To run tests, execute one of the following commands:

  • Recommended:
pytest tests
  • All tests (this is not recommended as there are existing tests in Trilinos which are not working):
pytest
  • One specific test file:
pytest path/to/your_file.py
  • One specific test in a file:
pytest path/to/your_file.py::name_of_test

If you want to add print statements / see the print statements in the terminal, you should run with the -s:

pytest tests -s

Run pyoptpp tests with address sanitizer on

Configure pyoptpp with address sanitizer

cmake -Bbuild -S. -DDEBUG_MEMORY=1

Build

cmake --build build

Copy the module to the virtual environment. so file might have a slightly different name depending on OS/python version

cp build/src/OPTPP-python/_pyoptpp.cpython-313-x86_64-linux-gnu.so .venv/lib/python3.13/site-packages/everest_optimizers/pyoptpp/_pyoptpp.cpython-313-x86_64-linux-gnu.so

Run the OPTPP tests. The preload should point to your locally installed libasan.so.

LD_PRELOAD=/usr/lib64/libasan.so.8.0.0 pytest "tests/OPTPP" -svvv --cache-clear

Linting and Formatting

Python:

  • We use ruff for python linting. To install ruff, use:
pip install ruff
  • To run ruff, do the following commands:
ruff format .
ruff check --select ALL
  • To only run ruff on a select folder or file, do these commands (example):
ruff format src/
ruff check src/

ruff format src/everest_optimizers_utils/dummy_implementation.py
ruff check src/everest_optimizers_utils/dummy_implementation.py

C++:

  • We use clang-format for c++ formatting. Install clang-format like this:
sudo apt install clang-format
  • To format a c++ or c file (or header file), use
clang-format -i your_file.cpp
  • You can run the following command to format all files in your project!
find . -regex '.*\.\(cpp\|hpp\|cc\|c\|h\)' -exec clang-format -i {} +

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

everest_optimizers-0.4.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

everest_optimizers-0.4.2-cp314-cp314-macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

everest_optimizers-0.4.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

everest_optimizers-0.4.2-cp313-cp313-macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

everest_optimizers-0.4.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

everest_optimizers-0.4.2-cp312-cp312-macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

everest_optimizers-0.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

everest_optimizers-0.4.2-cp311-cp311-macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file everest_optimizers-0.4.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fad9b24ea9bf3e7918e17381242301d7838c33ff07f8832851223acdb714081a
MD5 883a9a6988a33117b96b66b25966c385
BLAKE2b-256 907bb3c27b4db23de49d242a939959f09dc2b0ae8f643e4091d4202e3eaf0164

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file everest_optimizers-0.4.2-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c140438040532b78d41498bbeab8bc921c6d3a786e904b7db3c41866b8e2903b
MD5 85320a46d61b706d1e43304a6b1f6efe
BLAKE2b-256 ecdc5e30979aedd950b8737a2780a9fba37064c509ce2e079b506dab580b65aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp314-cp314-macosx_15_0_arm64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file everest_optimizers-0.4.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8d5b519b31e209be559a9ddabf97c813869721eaf84506d18b3db46e51e18605
MD5 17e8fa2e6f1280fa3b36456e7b382c83
BLAKE2b-256 b379d84ae655d426f690c15af6ad88a1b2be92bf9ff3543bc44597ffecd8a334

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file everest_optimizers-0.4.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7015e54c247bfd84ed9db8d45cfb2cb2c1381e3f0479b4dbf180777b7f9a4e02
MD5 e1405aa8f3ce44a57f0b85bb8a06de45
BLAKE2b-256 1e58a863307a5176be61b9963ce6b4dd278ae53d19d3fdc475eabd64aedb3172

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file everest_optimizers-0.4.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 928c93bc9341b2c3e912de73586adaa37cf3195250147e517f762b971a44b8bf
MD5 7c90113ac2354f5910f1a990a8a01dcd
BLAKE2b-256 99edd729a774662d1f1d68cd31cad68ea9c70e85fc2a11d04cd6bfd38bd15ba6

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file everest_optimizers-0.4.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 77551af2058d74a3e90cd6aa4de412a2d8d01b2e209df8978069bcdf2c8ef91d
MD5 c56557a46387fc289ef0f3a53738c7f9
BLAKE2b-256 0c8759c5c80d0a28c837974078de20e6f13ff8afff896028c3eb7bc4370da69e

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file everest_optimizers-0.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e8279331a159147fcfbd69bdd1bf087fea69efd20d67fad2112adbb99f4d8ed
MD5 50bd8e13dcf6067e95db736e569a03ff
BLAKE2b-256 b2a66ea827c9e8cd2b055a2ab70a28c27d23e7697fe3e37445663993acf9bb10

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file everest_optimizers-0.4.2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 58987a7572947be33e8b3c67b460d9094e8b1908fe615a723e7ad5b29ade45ae
MD5 2e967f0bec4c816946f3c00a42367ceb
BLAKE2b-256 a0f58479b7d610062344878ab2f46a67f7b8d04890c84101a8a2173e4fede257

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.2-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: publish.yml on equinor/everest-optimizers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page