Skip to content

H0R5E/dtocean-logistics

 
 

Repository files navigation

appveyor codecov Codacy Badge release

DTOcean Logistics Module

The DTOcean Logistics Module is a library for calculating optimal marine logistics, including port, vessel and equipment selection, and weather window analysis, in conjunction with the dtocean-installation and dtocean-maintenance DTOcean modules. Each operation is optimised either for minimum cost or for minimum duration.

See dtocean-app or dtocean-core to use this package within the DTOcean ecosystem.

* For python 2.7 only.

Installation

Installation and development of dtocean-logistics uses the Anaconda Distribution (Python 2.7)

Conda Package

To install:

$ conda install -c defaults -c conda-forge -c dataonlygreater dtocean-logistics

Source Code

Conda can be used to install dependencies into a dedicated environment from the source code root directory:

$ conda create -n _dtocean_logis python=2.7 pip

Activate the environment, then copy the .condrc file to store installation
channels:

$ conda activate _dtocean_logis
$ cd \\path\\to\\dtocean-logistics
$ copy .condarc %CONDA_PREFIX%

OR, if you're using Powershell:

$ conda activate _dtocean_logis
$ cd \\path\\to\\dtocean-logistics
$ 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-logistics and its dependencies using conda and pip:

$ cd \\path\\to\\dtocean-logistics
$ conda install --file requirements-conda-dev.txt
$ pip install -e .

To deactivate the conda environment:

$ conda deactivate

Tests

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_logis

Install packages required for testing to the environment (one time only):

$ conda install mock pytest pytest-cov=2.5.1 pytest-mock

Run the tests:

$ pytest tests

Uninstall

To uninstall the conda package:

$ conda remove dtocean-logistics

To uninstall the source code and its conda environment:

$ conda remove --name _dtocean_logis --all

Usage

Example scripts are available in the "examples" folder of the source code.

$ cd examples
$ python example.py

Contributing

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.

Credits

This package was initially created as part of the EU DTOcean project by:

It is now maintained by Mathew Topper at Data Only Greater.

License

GPL-3.0

About

Logistics submodule for the DTOcean tools

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%