iwopy


Nameiwopy JSON
Version 0.3.1 PyPI version JSON
download
home_pageNone
SummaryFraunhofer IWES optimization tools in Python
upload_time2024-11-28 09:03:30
maintainerJonas Schulte
docs_urlNone
authorJonas Schulte, Bernhard Stoevesandt
requires_python>=3.8
licenseMIT License Copyright (c) 2022 FraunhoferIWES Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords optimization interface
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # iwopy

Fraunhofer IWES optimization tools in Python

![IWOPY Logo](Logo_IWOPY_white.svg)

## Overview

The `iwopy` package is in fact a meta package that provides interfaces to other open-source Python optimization packages out there. Currently this includes

- [pymoo](https://pymoo.org/index.html)
- [pygmo](https://esa.github.io/pygmo2/index.html)
- [scipy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html)
- (more to come with future versions)

`iwopy` can thus be understood as an attempt to provide *the best of all worlds* when it comes to solving optimization problems with Python. This has not yet been achieved, since above list of accessable optimization packages is obviously incomplete, but it's a start. All the credit for implementing the invoked optimizers goes to the original package providers.

The basic idea of `iwopy` is to provide abstract base classes, that can be concretized for any kind of problem by the users, and the corresponding solver interfaces. However, also some helpful problem wrappers and an original optimizer are provided in addition:

- Problem wrapper `LocalFD`: Calculates derivatives by finite differences
- Problem wrapper `RegularDiscretizationGrid`: Puts the problem on a Grid
- Optimizer `GG`: *Greedy Gradient* optimization with constraints

All calculations support vectorized evaluation of a complete population of parameters. This is useful for heuristic approaches like genetic algorithms, but also for evaluating gradients. It can lead to a vast speed-up and should be invoked whenever possible. Check the examples (or the API) for details.

Documentation: [https://fraunhoferiwes.github.io/iwopy.docs/index.html](https://fraunhoferiwes.github.io/iwopy.docs/index.html)

Source code: [https://github.com/FraunhoferIWES/iwopy](https://github.com/FraunhoferIWES/iwopy)

PyPi reference: [https://pypi.org/project/iwopy/](https://pypi.org/project/iwopy/)

Anaconda reference: [https://anaconda.org/conda-forge/iwopy](https://anaconda.org/conda-forge/iwopy)

## Citation

Please cite the JOSS paper [IWOPY: Fraunhofer IWES optimization tools in
Python](https://doi.org/10.21105/joss.06014)

 [![DOI](https://joss.theoj.org/papers/10.21105/joss.06014/status.svg)](https://doi.org/10.21105/joss.06014)

 Bibtex:
 ```
@article{Schulte2024, 
    doi = {10.21105/joss.06014}, 
    url = {https://doi.org/10.21105/joss.06014}, 
    year = {2024}, 
    publisher = {The Open Journal}, 
    volume = {9}, 
    number = {102}, 
    pages = {6014}, 
    author = {Jonas Schulte}, 
    title = {IWOPY: Fraunhofer IWES optimization tools in Python}, 
    journal = {Journal of Open Source Software} 
}
 ```
 
## Requirements

The supported Python versions are:

- `Python 3.7`
- `Python 3.8`
- `Python 3.9`
- `Python 3.10`
- `Python 3.11`
- `Python 3.12`

## Installation via pip

### Virtual Python environment

We recommend working in a Python virtual environment and install `iwopy` there. Such an environment can be created by

```console
python -m venv /path/to/my_venv
```

and afterwards be activated by

```console
source /path/to/my_venv/bin/activate
```

Note that in the above commands `/path/to/my_venv` is a placeholder that should be replaced by a path to a (non-existing) folder of your choice, for example `~/venv/iwopy`.

All subsequent installation commands via `pip` can then be executed directly within the active environment without changes. After your work with `iwopy` is done you can leave the environment by the command `deactivate`.

### Standard users

As a standard user, you can install the latest release via [pip](https://pypi.org/project/iwopy/) by

```console
pip install iwopy
```

This in general corresponds to the `main` branch at [github](https://github.com/FraunhoferIWES/iwopy). Alternatively, you can decide to install the latest pre-release developments (non-stable) by

```console
pip install git+https://github.com/FraunhoferIWES/iwopy@dev#egg=iwopy
```

Notice that the above default installation does not install the third-party optimization
packages. `iwopy` will tell you in an error message that it is missing a package, with
a hint of installation advice. You can avoid this step by installing all supported
optimzer packages by installing those optoinal packages by addig `[opt]`:

```console
pip install iwopy[opt]
```

or

```console
pip install git+https://github.com/FraunhoferIWES/iwopy@dev#egg=iwopy[opt]
```

### Developers

The first step as a developer is to clone the `iwopy` repository by

```console
git clone https://github.com/FraunhoferIWES/iwopy.git
```

Enter the root directory by

```console
cd iwopy
```

Then you can either install from this directory via

```console
pip install -e .
```

Notice that the above default installation does not install the third-party optimization
packages. `iwopy` will tell you in an error message that it is missing a package, with
a hint of installation advice. You can avoid this step by installing all supported
optimzer packages by installing those optoinal packages by addig `[opt]`:

```console
pip install -e .[opt]
```

## Installation via conda

### Preparation (optional)

It is strongly recommend to use the `libmamba` dependency solver instead of the default solver. Install it once by

```console
conda install conda-libmamba-solver -n base -c conda-forge
```

We recommend that you set this to be your default solver, by

```console
conda config --set solver libmamba
```

### Standard users

The `iwopy` package is available on the channel [conda-forge](https://anaconda.org/conda-forge/iwopy). You can install the latest version by

```console
conda install -c conda-forge iwopy
```

### Developers

For developers using `conda`, we recommend first installing `iwopy` as described above, then removing only the `iwopy` package while keeping the dependencies, and then adding `iwopy` again from a git using `conda develop`:

```console
conda install iwopy conda-build -c conda-forge
conda remove iwopy --force
git clone https://github.com/FraunhoferIWES/iwopy.git
cd iwopy
conda develop .
```

Concerning the `git clone` line, we actually recommend that you fork `iwopy` on GitHub and then replace that command by cloning your fork instead.

## Testing

For testing, please clone the repository and install the required dependencies
(`flake8`, `pytest`, `pygmo`, `pymoo`):

```console
git clone https://github.com/FraunhoferIWES/iwopy.git
cd iwopy
pip install .[test]
```

If you are a developer you might want to replace the last line by
```console
pip install -e .[test]
```
for dynamic installation from the local code base.

The tests are then run by
```console
pytest tests
```

## Contributing

Please feel invited to contribute to `iwopy`! Here is how:

1. Fork _iwopy_ on _github_.
2. Create a branch (`git checkout -b new_branch`)
3. Commit your changes (`git commit -am "your awesome message"`)
4. Push to the branch (`git push origin new_branch`)
5. Create a pull request [here](https://github.com/FraunhoferIWES/iwopy/pulls)

## Support

For trouble shooting and support, please 
- raise an issue [here](https://github.com/FraunhoferIWES/iwopy/issues),
- or start a discussion [here](https://github.com/FraunhoferIWES/iwopy/discussions),
- or contact the contributers.

Thanks for your help with improving *iwopy*!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "iwopy",
    "maintainer": "Jonas Schulte",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Optimization, Interface",
    "author": "Jonas Schulte, Bernhard Stoevesandt",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/72/b0/d792f453d7f159f895a81c2578fbececd3041b191272a84be0a2dee6d0bd/iwopy-0.3.1.tar.gz",
    "platform": null,
    "description": "# iwopy\n\nFraunhofer IWES optimization tools in Python\n\n![IWOPY Logo](Logo_IWOPY_white.svg)\n\n## Overview\n\nThe `iwopy` package is in fact a meta package that provides interfaces to other open-source Python optimization packages out there. Currently this includes\n\n- [pymoo](https://pymoo.org/index.html)\n- [pygmo](https://esa.github.io/pygmo2/index.html)\n- [scipy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html)\n- (more to come with future versions)\n\n`iwopy` can thus be understood as an attempt to provide *the best of all worlds* when it comes to solving optimization problems with Python. This has not yet been achieved, since above list of accessable optimization packages is obviously incomplete, but it's a start. All the credit for implementing the invoked optimizers goes to the original package providers.\n\nThe basic idea of `iwopy` is to provide abstract base classes, that can be concretized for any kind of problem by the users, and the corresponding solver interfaces. However, also some helpful problem wrappers and an original optimizer are provided in addition:\n\n- Problem wrapper `LocalFD`: Calculates derivatives by finite differences\n- Problem wrapper `RegularDiscretizationGrid`: Puts the problem on a Grid\n- Optimizer `GG`: *Greedy Gradient* optimization with constraints\n\nAll calculations support vectorized evaluation of a complete population of parameters. This is useful for heuristic approaches like genetic algorithms, but also for evaluating gradients. It can lead to a vast speed-up and should be invoked whenever possible. Check the examples (or the API) for details.\n\nDocumentation: [https://fraunhoferiwes.github.io/iwopy.docs/index.html](https://fraunhoferiwes.github.io/iwopy.docs/index.html)\n\nSource code: [https://github.com/FraunhoferIWES/iwopy](https://github.com/FraunhoferIWES/iwopy)\n\nPyPi reference: [https://pypi.org/project/iwopy/](https://pypi.org/project/iwopy/)\n\nAnaconda reference: [https://anaconda.org/conda-forge/iwopy](https://anaconda.org/conda-forge/iwopy)\n\n## Citation\n\nPlease cite the JOSS paper [IWOPY: Fraunhofer IWES optimization tools in\nPython](https://doi.org/10.21105/joss.06014)\n\n [![DOI](https://joss.theoj.org/papers/10.21105/joss.06014/status.svg)](https://doi.org/10.21105/joss.06014)\n\n Bibtex:\n ```\n@article{Schulte2024, \n    doi = {10.21105/joss.06014}, \n    url = {https://doi.org/10.21105/joss.06014}, \n    year = {2024}, \n    publisher = {The Open Journal}, \n    volume = {9}, \n    number = {102}, \n    pages = {6014}, \n    author = {Jonas Schulte}, \n    title = {IWOPY: Fraunhofer IWES optimization tools in Python}, \n    journal = {Journal of Open Source Software} \n}\n ```\n \n## Requirements\n\nThe supported Python versions are:\n\n- `Python 3.7`\n- `Python 3.8`\n- `Python 3.9`\n- `Python 3.10`\n- `Python 3.11`\n- `Python 3.12`\n\n## Installation via pip\n\n### Virtual Python environment\n\nWe recommend working in a Python virtual environment and install `iwopy` there. Such an environment can be created by\n\n```console\npython -m venv /path/to/my_venv\n```\n\nand afterwards be activated by\n\n```console\nsource /path/to/my_venv/bin/activate\n```\n\nNote that in the above commands `/path/to/my_venv` is a placeholder that should be replaced by a path to a (non-existing) folder of your choice, for example `~/venv/iwopy`.\n\nAll subsequent installation commands via `pip` can then be executed directly within the active environment without changes. After your work with `iwopy` is done you can leave the environment by the command `deactivate`.\n\n### Standard users\n\nAs a standard user, you can install the latest release via [pip](https://pypi.org/project/iwopy/) by\n\n```console\npip install iwopy\n```\n\nThis in general corresponds to the `main` branch at [github](https://github.com/FraunhoferIWES/iwopy). Alternatively, you can decide to install the latest pre-release developments (non-stable) by\n\n```console\npip install git+https://github.com/FraunhoferIWES/iwopy@dev#egg=iwopy\n```\n\nNotice that the above default installation does not install the third-party optimization\npackages. `iwopy` will tell you in an error message that it is missing a package, with\na hint of installation advice. You can avoid this step by installing all supported\noptimzer packages by installing those optoinal packages by addig `[opt]`:\n\n```console\npip install iwopy[opt]\n```\n\nor\n\n```console\npip install git+https://github.com/FraunhoferIWES/iwopy@dev#egg=iwopy[opt]\n```\n\n### Developers\n\nThe first step as a developer is to clone the `iwopy` repository by\n\n```console\ngit clone https://github.com/FraunhoferIWES/iwopy.git\n```\n\nEnter the root directory by\n\n```console\ncd iwopy\n```\n\nThen you can either install from this directory via\n\n```console\npip install -e .\n```\n\nNotice that the above default installation does not install the third-party optimization\npackages. `iwopy` will tell you in an error message that it is missing a package, with\na hint of installation advice. You can avoid this step by installing all supported\noptimzer packages by installing those optoinal packages by addig `[opt]`:\n\n```console\npip install -e .[opt]\n```\n\n## Installation via conda\n\n### Preparation (optional)\n\nIt is strongly recommend to use the `libmamba` dependency solver instead of the default solver. Install it once by\n\n```console\nconda install conda-libmamba-solver -n base -c conda-forge\n```\n\nWe recommend that you set this to be your default solver, by\n\n```console\nconda config --set solver libmamba\n```\n\n### Standard users\n\nThe `iwopy` package is available on the channel [conda-forge](https://anaconda.org/conda-forge/iwopy). You can install the latest version by\n\n```console\nconda install -c conda-forge iwopy\n```\n\n### Developers\n\nFor developers using `conda`, we recommend first installing `iwopy` as described above, then removing only the `iwopy` package while keeping the dependencies, and then adding `iwopy` again from a git using `conda develop`:\n\n```console\nconda install iwopy conda-build -c conda-forge\nconda remove iwopy --force\ngit clone https://github.com/FraunhoferIWES/iwopy.git\ncd iwopy\nconda develop .\n```\n\nConcerning the `git clone` line, we actually recommend that you fork `iwopy` on GitHub and then replace that command by cloning your fork instead.\n\n## Testing\n\nFor testing, please clone the repository and install the required dependencies\n(`flake8`, `pytest`, `pygmo`, `pymoo`):\n\n```console\ngit clone https://github.com/FraunhoferIWES/iwopy.git\ncd iwopy\npip install .[test]\n```\n\nIf you are a developer you might want to replace the last line by\n```console\npip install -e .[test]\n```\nfor dynamic installation from the local code base.\n\nThe tests are then run by\n```console\npytest tests\n```\n\n## Contributing\n\nPlease feel invited to contribute to `iwopy`! Here is how:\n\n1. Fork _iwopy_ on _github_.\n2. Create a branch (`git checkout -b new_branch`)\n3. Commit your changes (`git commit -am \"your awesome message\"`)\n4. Push to the branch (`git push origin new_branch`)\n5. Create a pull request [here](https://github.com/FraunhoferIWES/iwopy/pulls)\n\n## Support\n\nFor trouble shooting and support, please \n- raise an issue [here](https://github.com/FraunhoferIWES/iwopy/issues),\n- or start a discussion [here](https://github.com/FraunhoferIWES/iwopy/discussions),\n- or contact the contributers.\n\nThanks for your help with improving *iwopy*!\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 FraunhoferIWES  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Fraunhofer IWES optimization tools in Python",
    "version": "0.3.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/FraunhoferIWES/iwopy/issues",
        "Changelog": "https://github.com/FraunhoferIWES/iwopy/blob/main/CHANGELOG.md",
        "Documentation": "https://fraunhoferiwes.github.io/iwopy.docs/index.html",
        "Homepage": "https://github.com/FraunhoferIWES/iwopy",
        "Repository": "https://github.com/FraunhoferIWES/iwopy.git"
    },
    "split_keywords": [
        "optimization",
        " interface"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfb46e778f0fc779c80aa114c8224c4fc4edb80b15b82422b1ccfa76b5489a1e",
                "md5": "783ce3725edf4cacaad95c73f1ca60e3",
                "sha256": "3e7393ca327322201f3e2a10207cff424fadcd6eb2d1887c0132e88907d4c59b"
            },
            "downloads": -1,
            "filename": "iwopy-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "783ce3725edf4cacaad95c73f1ca60e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 89890,
            "upload_time": "2024-11-28T09:03:28",
            "upload_time_iso_8601": "2024-11-28T09:03:28.369451Z",
            "url": "https://files.pythonhosted.org/packages/cf/b4/6e778f0fc779c80aa114c8224c4fc4edb80b15b82422b1ccfa76b5489a1e/iwopy-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "72b0d792f453d7f159f895a81c2578fbececd3041b191272a84be0a2dee6d0bd",
                "md5": "14f1977e60a7985c52ebc84b56306048",
                "sha256": "bd7e123ff57e483af683f35339aee924621fa1d40b597ce47d75435e88658c5f"
            },
            "downloads": -1,
            "filename": "iwopy-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "14f1977e60a7985c52ebc84b56306048",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 71094,
            "upload_time": "2024-11-28T09:03:30",
            "upload_time_iso_8601": "2024-11-28T09:03:30.535756Z",
            "url": "https://files.pythonhosted.org/packages/72/b0/d792f453d7f159f895a81c2578fbececd3041b191272a84be0a2dee6d0bd/iwopy-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-28 09:03:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FraunhoferIWES",
    "github_project": "iwopy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "iwopy"
}
        
Elapsed time: 0.37144s