Skip to main content

Optimization tools

Project description

PyPI-Server Built Status Coverage ReadTheDocs

OPTOOL - Optimization tools

Generally usable utilities related to optimization problems.

Installation

optool can be installed from PyPI:

python -m pip install optool

Content

The source code is structured in a number of packages and modules, each of which serves a different purpose.

Packages

  • The package fields contains implementations for Pydantic-compatible field types.
  • The package optimization provides a convenient interface to numerical solvers for optimization problems.
  • The package serialization implements JSON-to-object converters and vice versa that can be used by Pydantic.

Modules

  • The module conversions offers various convenient function for converting data.
  • The module languages offers tools for i18n and L10n.
  • The module logging implements logging features.
  • The module math implements math operations.
  • The module orthography contains utilities for converting text.
  • The module parallel adds functionalities to run optimizations in parallel.
  • The module uom offers functionalities related to physical units of measurements.
  • The module util provides general purpose classes.

Dependencies

The following libraries are necessary to run the program code.

  • casadi allows to build efficient optimal control software with minimal effort.
  • humanize provides various common string-related utilities like turning a number into a fuzzy human-readable duration (e.g. 3 minutes ago).
  • inflection provides functions for string transformation such as to singularize and pluralize English words, to transform strings from camel case to underscored string, etc.
  • loguru intends to make Python logging less painful by adding a bunch of useful functionalities that solve caveats of the standard loggers.
  • numpy is the fundamental package for scientific computing with Python.
  • pandas provides fast, powerful, flexible and easy to use features for data analysis and manipulation.
  • pint allows to define, operate and manipulate physical quantities. It allows arithmetic operations between them and conversions from and to different units.
  • pint-pandas provides an extension to Pandas, which allows Pandas to recognize the quantities and store them in Pandas data frames and series.
  • pydantic provides extensive data validation features and serialization capabilities using Python type hints.
  • pytz allows accurate and cross-platform timezone calculations.

Development dependencies

The following additional libraries are necessary for development, which are however automatically installed when the corresponding tox commands are used. Hence, tox is the only Python package stringently necessary.

  • autodoc-pydantic allows to integrate pydantic models in the Sphinx documentation.
  • babel simplifies internationalizing and localizing
  • docformatter formats the docstrings.
  • flake8 offers tools to enforce code style guides.
  • isort provides a command line utility, Python library and plugins for various editors to quickly sort all imports of a project.
  • mypy offers static type checking.
  • myst-parser[linkify] is a Sphinx and Docutils extension to parse MyST, a rich and extensible flavour of Markdown.
  • pydata-sphinx-theme is a clean, Bootstrap-based Sphinx theme.
  • pytest-cov provides a plugin to Pytest for measuring code coverage.
  • pytest provides a framework that makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries.
  • setuptools provides tools to easily download, build, install, upgrade, and uninstall Python packages.
  • sphinx-autodoc-typehints allows to use Python type annotations for documenting acceptable argument types and return value types of functions.
  • sphinx-copybutton adds a copy button to each code cell of the Sphinx documentation.
  • sphinx-jsonschema is a Sphinx extension to display JSON Schema.
  • sphinx-pydantic allows to generate Sphinx documentation from Pydantic objects.
  • sphinx-togglebutton is a Sphinx extension that allows to add a toggle button to sections of the documentation.
  • sphinx-toggleprompt adds a python prompt toggle to each code cell of the Sphinx documentation.
  • sphinx offers functionalities to easily create intelligent and beautiful documentation for Python projects.
  • toml provides features to parse and create Tom’s obvious, minimal language (TOML) files typically used for project configurations.
  • tox automates and standardizes testing in Python by offering a generic virtualenv management and test CLI. It allows to run predefined test procedures on various environments on personal computers as well as on CI servers.
  • types-pytz is the type stub package for the pytz package.
  • yapf formats Python source code files.

Changelog

Version 0.1.0 (Initial release)

Version 0.2.0 (Complete revision of the code)

  • Replaces pyfields with pydantic.
  • Adds Pydantic-compatible fields to validate quantities, time-series, numerical arrays, Pandas DataFrames, etc.
  • Adds many physical quantities for validating values via Pydantic fields.
  • Revised API documentation.
  • Additional documentation is now written in Markdown instead of reStructuredText.
  • Fixes a bug on Windows related to file separator in path name.
  • Adds check if validation of subtypes is passed on.
  • Revises formulation of ordinary differential equations (ODEs).
  • Adds new tests that use ODE representation and parallelization feature.
  • Removes dependency on matplotlib and all related plotting utilities.
  • Adds possibility to compare Pydantic models that have Numpy arrays as fields.
  • Allows coercion from types compatible to floats in PositiveFiniteFloat (default is set to strict = False).
  • Removes class Horizon. Instead, the class DatetimeIndex of Pandas is used.

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 Distribution

optool-0.2.0-py3-none-any.whl (50.0 kB view hashes)

Uploaded Python 3

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