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.0-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.0-cp314-cp314-macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

everest_optimizers-0.4.0-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.0-cp313-cp313-macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

everest_optimizers-0.4.0-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.0-cp312-cp312-macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

everest_optimizers-0.4.0-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.0-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.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea434da6c9308211ed2539ba48de2c33855eef66e5bee3ba6c8233fd0a385b67
MD5 8dcd21d3f075eb5b1be17ff3c2b947e1
BLAKE2b-256 bdff78ddbfc711de4f30763137f82390f8938debfcd1c0955e58eee67344ec57

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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.0-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bc7cc289c6c09f0f2ef192c7fc83fa689482f691ad064da6cd690d7d3c2ace3d
MD5 be5aa184685471d2d81ad9be9afc52f7
BLAKE2b-256 5be1b51b5e8cd82c7922db6b0e0849442afaf7cfeb4d9fa47bbdc21e205ca440

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 45309b98bb5143928d629a87a781d7ac68a6f8f4fee0ade32f300c87e2ce0786
MD5 62d12aaea5f7c8be68e77029b5208aea
BLAKE2b-256 3022f2a5a1eb1f57abedb3ddd9b39a7aec88f1329a542e819da2455eb0c272e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 be7c716ce5d2bed915c84fa41589d6b3b431eeafcccf9e0d26688648be4b6a2b
MD5 0f69e962b3b61470049631911a52be67
BLAKE2b-256 fca3fd3efd4273e529b2d5b3600b48ed567fd4092980f4185a65b082ffe2301f

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd46a955c325cb39e1bc2611bccb3fe0d87d74d5f61d02728cbfdcf2a22a9c19
MD5 90d01ede30472ed641f7748242fe7e04
BLAKE2b-256 83447e606d6d6cf95aca10c6b73ba5628651e43eea26f7d55afb2b8cd4be54e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fd7f758a63884070781812e70d3c1e6b9431e4017db63b27943212531611be75
MD5 a1503e25e52d32088162ed3e1224188a
BLAKE2b-256 1f2d58f51aa09c44f9d8ba3c72bb0776a23ca9acd8ef9d5db9025034f3a6af5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 327872ae34cc387bc8f4037be53e95e29e673ac7dc10a5de76bc2d1babf6cf74
MD5 715b80bb42206415f2fc8f83aa74b5d1
BLAKE2b-256 a719bb3fdd482a14e590da568fe30df1d107e8f1a95771d1c1e19349f8e9a4b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for everest_optimizers-0.4.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 dfdb2a3b2d5baa90195e885e7c10f94c6c8ab0b838d6ab43894743a42efae32e
MD5 a468f6f3d8b2acaa41a926d5ad93feee
BLAKE2b-256 4d8cc6bd001a194697e9df2c42bbbb41fd5a95dcc071204d8e96d4e2a1d8ed20

See more details on using hashes here.

Provenance

The following attestation bundles were made for everest_optimizers-0.4.0-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