Skip to main content

A small package to do some finoptim optimisations

Project description

FinOps package

The best python package to help you optimise your cloud spendings

Usage example

import finoptim as fp
import pandas as pd


past_usage = pd.DataFrame(...)
guid_to_price = fp.cloud.load_aws_prices(as_dict=True)
prices = np.array(past_usqge.index.map(guid_to_price))

usage = fp.normalize(past_usage)

res = fp.optimise_past(usage, prices)
predictions = pd.DataFrame(...) # some SQL query
current_reservations = pd.DataFrame(...) # some SQL query

normalize_reservations = fp.normalize(current_reservations)

res = fp.optimise_past(predictions, prices)

Now the res object hold the best levels of commitment on the time period.

guid_to_instance_name = {"K7YHHNFGTNN2DP28" : 'i3.large', 'SAHHHV5TXVX4DCTS' : 'r5.large'}
res.format(instance_type=guid_to_instance_name)
print(res)
>>>
╭─────────────────┬──────────────────────────┬───────────────╮
 instance_type     three_year_commitments   price_per_day 
├─────────────────┼──────────────────────────┼───────────────┤
 i3.large                   1338                2,886     
 r5.large                   1570                2,564     
 savings plans              1937                1,937     
╰─────────────────┴──────────────────────────┴───────────────╯

TODO

lib convenience

  • possibility to precise the period of the data in case it is not inferred correctly
  • coverage must follow the same inputs as cost
  • allow for long DataFrame as input
  • the cost function should return a gradient when evaluated (save some compute)
  • need to listen to keyboard interupt from Rust (harder than expected with multi threading)

actual problems

  • add in documentation that for now optimisation only works if you have RI < SP < OD
  • compute the better step size to avoid waiting too long (more or less done, but not even necessary with the inertial optimiser)
  • find a real stop condition for the inertial optimiser
  • can we guess the "eigenvectors" of the problem ? if we have estimations, we can set great parameters for the inertial optimiser

if the problem is $f(w) = \frac{1}{2} w^T A w :-: b^T w$ then the optimal parameters for the inertial optimiser are :

$$ \alpha = \left(\frac{2}{\sqrt{\lambda_1} + \sqrt{\lambda_n}} \right) ^2 $$

$$ \beta = \left( \frac{\sqrt{\lambda_n} - \sqrt{\lambda_1}}{\sqrt{\lambda_1} + \sqrt{\lambda_n}} \right) ^2 $$

with $\lambda_1$ and $\lambda_n$ respectively the smallest and largest eigenvalues of $A$

lets admit constant usage for all the instances. Then $f(w) = $

Project details


Download files

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

Source Distribution

finoptim-0.0.22.tar.gz (23.4 kB view details)

Uploaded Source

Built Distributions

finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (1.4 MB view details)

Uploaded PyPy manylinux: glibc 2.12+ i686

finoptim-0.0.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

finoptim-0.0.22-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

finoptim-0.0.22-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl (1.4 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.12+ i686

finoptim-0.0.22-cp311-none-win_amd64.whl (360.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

finoptim-0.0.22-cp311-none-win32.whl (317.1 kB view details)

Uploaded CPython 3.11 Windows x86

finoptim-0.0.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

finoptim-0.0.22-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

finoptim-0.0.22-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl (1.4 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.12+ i686

finoptim-0.0.22-cp311-cp311-macosx_11_0_arm64.whl (471.6 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

finoptim-0.0.22-cp311-cp311-macosx_10_7_x86_64.whl (519.1 kB view details)

Uploaded CPython 3.11 macOS 10.7+ x86-64

finoptim-0.0.22-cp310-none-win_amd64.whl (360.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

finoptim-0.0.22-cp310-none-win32.whl (317.1 kB view details)

Uploaded CPython 3.10 Windows x86

finoptim-0.0.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

finoptim-0.0.22-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

finoptim-0.0.22-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl (1.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ i686

finoptim-0.0.22-cp310-cp310-macosx_11_0_arm64.whl (471.6 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

finoptim-0.0.22-cp310-cp310-macosx_10_7_x86_64.whl (519.1 kB view details)

Uploaded CPython 3.10 macOS 10.7+ x86-64

File details

Details for the file finoptim-0.0.22.tar.gz.

File metadata

  • Download URL: finoptim-0.0.22.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.2.3

File hashes

Hashes for finoptim-0.0.22.tar.gz
Algorithm Hash digest
SHA256 c228333de5671f367c8653e82c4c575bd950f1767372cc7da06e379f1d2c60fc
MD5 13d0cf9c46435f7423c0888a4c0be72b
BLAKE2b-256 424d6a8d2d66a84ac5e19cdec02df08a6be8f8ad1e411b02ae297ecc239c89b5

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b22a620c253d33ac6a64246e1aee8c392f9b253a87df324f99005a35d2a2fce5
MD5 2ca5c3e0d3d222e0a9939f05425c5ba1
BLAKE2b-256 a7b2437fa64b9714f4e034ee35835a68f6487c1ddfaa12fd605c54fc9d950f24

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 298b6e907b4881a137b80b158ef568547ee265496d71f04aded74bc87078ad08
MD5 353f1c9cfa0f8459073c19c0f6be938b
BLAKE2b-256 8e5c66f1bd9bb8e2915d9300772640c2b37afe3216c63e8d6ec6a15852919d87

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 c9fa461090f7fc4f4ce3db37aabb6664cc9e0ea3bb53244ba0189e501bc82498
MD5 2b8103bee33ca9855e95b20c61824a43
BLAKE2b-256 51535e7f5f598c4a0841b71c331c80b397b58de70d6ad014c891b6701f188b06

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3bde0dd6b994e9d6ab969ed330c8457d16ead28c42b8a343e38f8686b70e2db4
MD5 7ef0dfe6f1e9cd4cf840c1378bc3bb3e
BLAKE2b-256 80f7aff64e64fa1572ba2a1d81b0cc3a4f8f07b3fdf6422b33d61d49082ad946

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d74bc064d7ce2afadf43e3935ac35f588e5bdbbc35bdc5577b2a45378e598eae
MD5 f4a5e1bb3c836377f93ecff4be4e989b
BLAKE2b-256 af92a01a803881e999ef89a5b3c5a2177679061cd2b7c7e35b6625b7f2e67e13

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 887561e0b481537a16a1ad9b802217e1f1c47875c9f0c4b8c001395eec9cd758
MD5 7130301c4634bafad078a7590725c172
BLAKE2b-256 181da99c04cbff746a138d76533c66b0d3d607f281eaa97fec59de51d640274f

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 a4bd43aba7cbaf8e92504b774616d7ba0573d127ec81349e211f55018def6605
MD5 7a19f6ac4f7def8ec25e51903a5b96d8
BLAKE2b-256 717eb30f25ff03a9e8209e18e9631a1eb4d160468d07b05a371d8160efdab800

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp311-none-win32.whl.

File metadata

  • Download URL: finoptim-0.0.22-cp311-none-win32.whl
  • Upload date:
  • Size: 317.1 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.2.3

File hashes

Hashes for finoptim-0.0.22-cp311-none-win32.whl
Algorithm Hash digest
SHA256 fbe47e239d99d66236dcf9c63be4044a68ae3c7385ab1bdb8fa87279e9f76bda
MD5 fbbc154d43cfaf219b1728098d6b9201
BLAKE2b-256 d5fc24abb0feeac86e61a38a744ae0ecceb42a270d2c724e70d01a6019b7393e

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26f9a959b607165f9b11fc63a0b9f67d68f9aae45de55ad045a5047d7a9dd7f7
MD5 f3bd689bc3ca81569781768ad38367a9
BLAKE2b-256 713588b8403c9d4fb708991296c60fdfe9772dfb586361768dddbdbaea8d1a4a

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3eaa2697f1bbe6dc241ef01a3b71e5c5d30112f1fc210af7b37e7f0d7ae76239
MD5 a5c429127bedf1671ab74743f58369f5
BLAKE2b-256 1e97b7e451b082b57c8ae823a19e9d8764922e7d63bb92dfd788a1b61fd73171

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 7d3d51cb65d56d8cb5654bf36bcb8de79cd444bc75c262cd7f8d6542a6be1203
MD5 07c62ad71cdc1b3bbf97d489f1116fa0
BLAKE2b-256 a9e0b8f4a54c4788ff4c79e7301b00d097d2d0b269f35060d2febf8879dd661d

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 400b75b8d248522309d03047a50c71e12c8a161460398b497923a36dce8e58a6
MD5 8a4e69d1f5eabc4603ee900ac881a683
BLAKE2b-256 182261dc1a4e335e343c91777cc7c5c5637f04a50ee7a80bb39dd4bcb0c9b18b

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp311-cp311-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 26cf494c80950c8129dd3a30e58a8ac9dda6b5d9c9259cb0f5ca86e9eccda4ab
MD5 e71b319fb186db7f31111177b405680d
BLAKE2b-256 4870dd02f2d07be8fecd31ef26092e424113e5a3bf8794b81d7e59d690a86a71

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 96e23381a9dddedce2cb5e2f611202ccaca31195d54256b540ff51ee02b7ce47
MD5 2da4c0e770e33da80293107a335536de
BLAKE2b-256 b7ac851ecdd46bee70471ff858c4874772b597e773135ff7c12153a8d09e13a8

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp310-none-win32.whl.

File metadata

  • Download URL: finoptim-0.0.22-cp310-none-win32.whl
  • Upload date:
  • Size: 317.1 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.2.3

File hashes

Hashes for finoptim-0.0.22-cp310-none-win32.whl
Algorithm Hash digest
SHA256 23ff6fa6cf699636434e3bad384e225ca9e723feee74ddb4b395961ce4f55c6a
MD5 38f7cc8f674ee6c9751510b40ea8fb31
BLAKE2b-256 a815f952b2d6ca0771ba2f0796c106320ad583ed5cf1111ae196193a8ff8d777

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6e6e6c5beb30afa31a2a4f2645857ad8de30d69fbc626e25f2f6871ca5bd225
MD5 48153e6a885a4d43b63948438b7cbd6d
BLAKE2b-256 6e7921ac8efb5082bba07032ae28fdeb787e22542e97545eb71fd8bcfdae2587

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6add927719906658f23a1947913409e143a17db80de699d6e6866dd3bc36ff5a
MD5 e4bf913acf1d0f69d1e7d52e2f8a592a
BLAKE2b-256 f54c73909b993d375bbc25cf6089074a243857e678105dfc758567891fac4748

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 34d8f461a8e599375a2a0140183f1b33feb08c784cd2d967608a84f43cc6fbf1
MD5 f3c63519fd2332a3528996163f5d92e7
BLAKE2b-256 a38dac2b0885cd5f91a20fea8277f0fcd79ae5475e2de78578680e77654b1da5

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d399761b80cba77c23a53038affa249448c63cd549a76a749e843d991cb200b
MD5 f39017e70f60a5516aa220f640b960d6
BLAKE2b-256 ae384d7fc8a391a3e166c83c6c4ed4750d37ec52ad6ccaf694562ef73b9860e0

See more details on using hashes here.

File details

Details for the file finoptim-0.0.22-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for finoptim-0.0.22-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8fbe7bfed61010d14792d7ff87ada0b3e6fa8944a6166a64d9e4968dc1cba282
MD5 6ac86b6e7e7ddeb465474ffec38d20e9
BLAKE2b-256 31531b0a499dbb44dd5570e83908f370ca586ff4bc8a1d6763d418314808517f

See more details on using hashes here.

Supported by

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