Installation

Downloading WDRT

WDRT is distributed through the WDRT GitHub repository. The toolbox can either be downloaded via git or simply by visiting the the WDRT GitHub repository and downloading it directly.

Note

You may place the downloaded WDRT in any location you like; for the remainder of these instructions, the folder that contains the WDRT source code will be referred to as $WDRT_SOURCE.

Downloading Python

If you’re new to Python, we suggest one of the following Python distributions:

Note

WDRT is currently designed to run with Python 2.7.x. WDRT currently will not fully run on Python 3.5.x.

Install options

This page outlines two options for installing the WDRT. The first option (Installing WDRT for Python beginners) assumes that you are new to Python and gets you up an running as quickly as possible. The second option (Installing WDRT for experienced Python users) uses a method that allows you to more readily keep you local copy of the WDRT update to date with the latest version online.

Installing WDRT for Python beginners

Step 1 It can be a pain to install Python, NumPy, SciPy, Matplotlib, h5py and other dependencies that are needed to run WDRT. If you’re new to Python, the easiest approach is to start by installing the 2.7.x version of either of the following Python distributions:

Note

If you are using Anaconda, PythonXY or another non-Python.org distribution, you may need to install one of the packages identified in the Dependencies section. If you need to do so, you should install any needed modules via your distribution’s package manager.

Step 2 Download WDRT from the WDRT GitHub repository

Note

There may be several branches open on the repository at any given time for the purpose of developing new features. ONLY the Master branch is meant to be used outside of our development team. There is no guarantee that the toolbox will work as expected, or at all, if you are working with a non-master branch.

Step 3 Open a command window (Windows) or terminal window (OSX and Linux) and navigate to $WDRT_SOURCE. Once inside the $WDRT_SOURCE directory execute the following command to install WDRT:

python setup.py install --user

Step 4: Verify the installation’s functionality by running the examples located in``$WDRT_SOURCE/examples``

cd examples
python example_envSamplying.py
python example_contourApproach.py
python example_shortTermExtreme.py
python example_fatigue.py

Installing WDRT for experienced Python users

The following installation procedure allows for easier updating of the code with git, which can be downloaded here.

Step 1: Clone or download a copy of WDRT:

git clone http://wec-sim.github.io/WDRT $WDRT_SOURCE

Step 2: Add the $WDRT_SOURCE directory to your PYTHONPATH environment variable (Windows, Mac OSX, Linux).

Step 3: Verify the installation’s functionality by running the examples located in``$WDRT_SOURCE/examples``

cd examples
python example_envSamplying.py
python example_contourApproach.py
python example_shortTermExtreme.py
python example_fatigue.py

Configuring your PYTHONPTH

The following instructions will help you configure your PYTHONPATH, which is a search path Python uses for importing other python modules.

Windows:
1.) Navigate to Control Panel -> System -> Advanced system settings -> Environment Variables
2.) Click “New...”
3.) Under “Variable Name” type: PYTHONPATH
4.) Under “Variable Value” enter the location of your Python source directory (i.e “C:Python27”)
Linux/OS X
1.) Navigate to your home directory
2.) Add a line such as “export PYTHONPATH=“/path/where/your/modules/are/located” to your .bash_rc file if running Linux, or .bash_profile if running OS X
3.) Place the modules you would like to import in the directory you specified in the previous step

Dependencies

Python 2.7.x and the following Python packages are required to run WDRT. WDRT currently will not fully run on Python 3.5.x. These packages can easily be installed using using pip or your preferred package installation method:

Note

the netCDF4 package is only required if you are using a CDIP site in the ESSC module

Troubleshooting

Problem: I can’t run any of the examples.

Solutions: Check you PYTHONPATH or move the file you want to run into the main WDRT folder.

Problem: I can’t connect to the NDBC database to download the data I need.

Solution: Check your proxy/firewall settings. If you can download data from elsewhere through your proxy/firewall, check the status of the NDBC website with Down for Everyone.

Problem: I want to use the MLER toolbox, but it’s in an .egg file.

Solution: Make sure you have the easy install package, which can be downloaded here. Then, run the following command in the command line:

Python -m easy_install C:\path\to\mler.egg