This package provides the Electrical Sub-Systems design module for the DTOcean tools. It can design the electrical network of an array of fixed or floating wave or tidal ocean energy converters (constrained by the environment and device design), and calculate the cost and electrical losses. It optimises the design for minimum cost per unit exported power.
See dtocean-app or dtocean-core to use this package within the DTOcean ecosystem.
* For python 2.7 only.
Installation and development of dtocean-electrical uses the Anaconda Distribution (Python 2.7)
To install:
$ conda install -c defaults -c free -c dataonlygreater dtocean-electrical
Conda can be used to install dependencies into a dedicated environment from the source code root directory:
$ conda create -n _dtocean_electro python=2.7 pip
Activate the environment, then copy the .condrc
file to store installation
channels:
$ conda activate _dtocean_electro
$ copy .condarc %CONDA_PREFIX%
OR, if you're using Powershell:
$ conda activate _dtocean_electro
$ copy .condarc $env:CONDA_PREFIX
Install polite into the environment. For example, if installing it from source:
$ cd \\path\\to\\polite
$ conda install --file requirements-conda-dev.txt
$ pip install -e .
Finally, install dtocean-electrical and its dependencies using conda and pip:
$ cd \\path\\to\\dtocean-electrical
$ conda install --file requirements-conda-dev.txt
$ pip install -e .
To deactivate the conda environment:
$ conda deactivate
A test suite is provided with the source code that uses pytest.
If not already active, activate the conda environment set up in the Source Code section:
$ conda activate _dtocean_electro
Install packages required for testing to the environment (one time only):
$ conda install -y mock pytest pytest-cov=2.5.1 pytest-mock
Run the tests:
$ pytest tests
To uninstall the conda package:
$ conda remove dtocean-electrical
To uninstall the source code and its conda environment:
$ conda remove --name _dtocean_electro --all
Example scripts are available in the "examples" folder of the source code.
$ cd examples
$ conda install -y xlrd<2
$ python electrical_run.py
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
See this blog post for information regarding development of the DTOcean ecosystem.
Please make sure to update tests as appropriate.
This package was initially created as part of the EU DTOcean project by:
- Adam Collin at the University of Edinburgh
- Mathew Topper at TECNALIA
It is now maintained by Mathew Topper at Data Only Greater.