Skip to main content

DR C++/Python library

Project description

Build Status

Snoopy library

Documentation and tutorials : https://bv-dr.gitlab.io/Snoopy

Snoopy is an open source library for marine applications. Among other things, it contains the following sub-packages

  • Spectral : Routines for spectral analysis of sea-keeping results

    • Wave spectra (Jonswap, Ochihubble, spreading function…)

    • Manipulation of transfer function (RAOs)

    • Response spectrum

    • 2nd order response spectrum

  • TimeDomain

    • Reconstruction of seakeeping results in time domain (1st and 2nd order)

    • Convolution for wave radiation in time domain (from added-mass).

  • Fatigue

    • Rainflow counting

    • Spectral fatigue

  • Meshing

  • WaveKinematics : (Linear, wheeler stretching, 2nd order…)

Example of use

>>> from Snoopy import Spectral as sp
>>> spec = sp.Jonswap( hs = 1.0 , tp = 10.0 , gamma = 1.0)
>>> spec.plot()
Jonswap picture

How to install from pre-compiled library

Pre-compiled wheel package can be installed with :

pip install snoopy_bv-1.3.0-cp39-cp39-win_amd64.whl --no-deps

or, to upgrade (as version number is not always changed) :

pip install snoopy-bv --force-reinstall --no-deps

In case conda is used, it is recommended to install dependencies using conda (hence the –no-deps in above command line):

conda install --file requirements.txt

How to build from sources

  • Create a build folder, for instance “build”

  • Run cmake

go in “build” directory and run :

cmake .. -G"CodeBlocks - MinGW Makefiles"
  • Compile

mingw32-make.exe -j10

How to use in develop mode

To install in “developer mode” (uses current sources, does not copy in python environment) :

pip install -e C:\path_to_snoopy_location

How to install

to install in python environment :

pip install pathToRootfolder

How to package

  • The folder containing the .pyd should be in the SNOOPY_PYD environement variable

python setup.py bdist_wheel

How to install on Linux (tested with Ubuntu 20.04 with bash terminal)

  • clone in the folder snoopy_dev (using snoopy as name may cause problems)

git clone https://mar-gitlab.bureauveritas.com/applications/dr/snoopy.git snoopy_dev
  • compile the code in a build directory

cd snoopy_dev/Snoopy
mkdir build
cd build
cmake ..
make -j 10
  • install the package

cd ../..
pip install .

To install in develop mode:

pip install -e .

Dev notes:

Commit message

  • [FUN] : New feature

  • [ENH] : Enhancement of existing code

  • [BUG] : Bug correction, [BBUG] for really BIG BUG (with consequences in case of use…)

  • [QLT] : Quality (Comments, removal of dead code…)

  • [FIX] : Correction of compiling issue

  • [DAT] : Data added or modified

  • [DOC] : Document added or modified

  • [TEST] : Test added or modified

  • [INI] : Initial commit.

The subpackage should be mentioned after this Flag. For instance :

[ENH] TimeDomain : Performance optimization of ReconstructionRaoLocal

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 Distributions

snoopy_bv-2.0.0-cp310-cp310-win_amd64.whl (4.1 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

snoopy_bv-2.0.0-cp39-cp39-win_amd64.whl (4.1 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

snoopy_bv-2.0.0-cp38-cp38-win_amd64.whl (4.5 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

snoopy_bv-2.0.0-cp38-cp38-manylinux_2_24_x86_64.whl (6.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

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