Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBarker-NOAA committed Apr 3, 2017
2 parents cd49d83 + 4453e8a commit 2c3b665
Show file tree
Hide file tree
Showing 106 changed files with 8,718 additions and 3,242 deletions.
94 changes: 94 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ cy_*.c
empty_BW_image.png
.DS_Store
.cache/
*.swn
*.swo

*.ipynb_checkpoints/

Expand Down Expand Up @@ -53,6 +55,98 @@ py_gnome/junk_tiny.txt
py_gnome/tests/unit_tests/test_utilities/test_file_tools/test.bna
py_gnome/tests/unit_tests/test_utilities/test_file_tools/test_bad.bna

# ignore gnerated and sample data for tests

py_gnome/tests/junk.txt
py_gnome/tests/junk_large.txt
py_gnome/tests/unit_tests/ElementType_6.json
py_gnome/tests/unit_tests/Emulsification_1.json
py_gnome/tests/unit_tests/Evaporation_0.json
py_gnome/tests/unit_tests/LongIslandSoundMap.BNA
py_gnome/tests/unit_tests/Model.json
py_gnome/tests/unit_tests/Model.zip
py_gnome/tests/unit_tests/Skim_2.json
py_gnome/tests/unit_tests/Spill_0.json
py_gnome/tests/unit_tests/Water_0.json
py_gnome/tests/unit_tests/Waves_3.json
py_gnome/tests/unit_tests/Wind_1.json
py_gnome/tests/unit_tests/Wind_1_data.WND
py_gnome/tests/unit_tests/junk.txt
py_gnome/tests/unit_tests/junk_conda_list.txt
py_gnome/tests/unit_tests/junk_large.txt
py_gnome/tests/unit_tests/test_environment/sample_data/3D_circular.nc
py_gnome/tests/unit_tests/test_environment/sample_data/currents/
py_gnome/tests/unit_tests/test_environment/sample_data/staggered_sine_channel.nc
py_gnome/tests/unit_tests/test_environment/sample_data/tri_ring.nc
py_gnome/tests/unit_tests/test_weatherers/ElementType_6.json
py_gnome/tests/unit_tests/test_weatherers/Emulsification_1.json
py_gnome/tests/unit_tests/test_weatherers/Evaporation_0.json
py_gnome/tests/unit_tests/test_weatherers/LongIslandSoundMap.BNA
py_gnome/tests/unit_tests/test_weatherers/Model.json
py_gnome/tests/unit_tests/test_weatherers/Model.zip
py_gnome/tests/unit_tests/test_weatherers/Skim_2.json
py_gnome/tests/unit_tests/test_weatherers/Spill_0.json
py_gnome/tests/unit_tests/test_weatherers/Water_0.json
py_gnome/tests/unit_tests/test_weatherers/Waves_3.json
py_gnome/tests/unit_tests/test_weatherers/Wind_1.json
py_gnome/tests/unit_tests/test_weatherers/Wind_1_data.WND

#ignore generated and downloaded files from scripts
py_gnome/scripts/arctic_avg2_0001_gnome.nc
py_gnome/scripts/arctic_avg2_0002_gnome.nc
py_gnome/scripts/script_animation_demo/images/
py_gnome/scripts/script_animation_demo/raster.bmp
py_gnome/scripts/script_boston/EbbTides.cur
py_gnome/scripts/script_boston/EbbTidesShio.txt
py_gnome/scripts/script_boston/MassBayMap.bna
py_gnome/scripts/script_boston/MassBaySewage.cur
py_gnome/scripts/script_boston/MerrimackMassCoast.cur
py_gnome/scripts/script_boston/MerrimackMassCoastOSSM.txt
py_gnome/scripts/script_boston/WAC10msNW.cur
py_gnome/scripts/script_boston/WAC10msSW.cur
py_gnome/scripts/script_boston/gnome_profile
py_gnome/scripts/script_boston/script_boston.kmz
py_gnome/scripts/script_boston/script_boston.nc
py_gnome/scripts/script_boston/script_boston_uncertain.nc
py_gnome/scripts/script_chesapeake_bay/ChesapeakeBay.bna
py_gnome/scripts/script_chesapeake_bay/ChesapeakeBay.dat
py_gnome/scripts/script_chesapeake_bay/ChesapeakeBay.nc
py_gnome/scripts/script_chesapeake_bay/script_chesapeake_bay.nc
py_gnome/scripts/script_chesapeake_bay/script_chesapeake_bay_uncertain.nc
py_gnome/scripts/script_columbia_river/COOPSu_CREOFS24.nc
py_gnome/scripts/script_columbia_river/COOPSu_CREOFS24.nc.dat
py_gnome/scripts/script_columbia_river/columbia_river.bna
py_gnome/scripts/script_delaware_bay/DelawareRiverMap.bna
py_gnome/scripts/script_delaware_bay/FloodTides.cur
py_gnome/scripts/script_delaware_bay/FloodTidesShio.txt
py_gnome/scripts/script_delaware_bay/NW30ktwinds.cur
py_gnome/scripts/script_delaware_bay/Offshore.cur
py_gnome/scripts/script_delaware_bay/SW30ktwinds.cur
py_gnome/scripts/script_delaware_bay/script_delaware_bay.nc
py_gnome/scripts/script_guam/GuamMap.bna
py_gnome/scripts/script_guam/OutsideWAC.cur
py_gnome/scripts/script_guam/WACFTideShioHts.txt
py_gnome/scripts/script_guam/WACFloodTide.cur
py_gnome/scripts/script_guam/script_guam.nc
py_gnome/scripts/script_guam_get_data_test/GuamMap.bna
py_gnome/scripts/script_guam_get_data_test/OutsideWAC.cur
py_gnome/scripts/script_guam_get_data_test/WACFTideShioHts.txt
py_gnome/scripts/script_guam_get_data_test/WACFloodTide.cur
py_gnome/scripts/script_guam_get_data_test/script_guam.nc
py_gnome/scripts/script_ice/ak_arctic.bna
py_gnome/scripts/script_ice/script_ice.nc
py_gnome/scripts/script_plume/images/
py_gnome/scripts/script_plume/script_plume.nc
py_gnome/scripts/script_tamoc/HYCOM_3d.nc
py_gnome/scripts/script_tamoc/HYCOM_3d.nc.dat
py_gnome/scripts/script_tamoc/Input/case_01
py_gnome/scripts/script_tamoc/KIKT.osm
py_gnome/scripts/script_tamoc/cat
py_gnome/scripts/script_tamoc/diff.txt
py_gnome/scripts/script_tamoc/gulf_tamoc.nc
py_gnome/scripts/script_tamoc/images/


# ignore generated oildb
oil_library/oil_library/OilLib.db
oil_library/temp.txt
Expand Down
13 changes: 9 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
before_script:
before_script:
- yum update -y
- yum install gcc gcc-c++ -y
- yum install netcdf-devel -y # needed by the C++ code -- it can't find the conda versions
- yum install libXext libSM libXrender -y # needed by matplotlib on CentOS

# make sure the conda channels are set up right
# the last channel you add will be first on the list
- conda config --add channels NOAA-ORR-ERD
- conda config --add channels defaults
- conda config --add channels NOAA-ORR-ERD
- conda config --add channels conda-forge

# install the requirements
- conda install --file conda_requirements.txt

# get the oil libary package from gitlab
- pip install -U git+https://srccontrol.orr.noaa.gov/gnome/[email protected]#egg=oil_library
- cd ./py_gnome
- python ./setup.py develop

master:
master:
script:
- py.test -runslow
only:
only:
- master

develop:
Expand Down
33 changes: 29 additions & 4 deletions InstallingWithAnaconda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ manager that Anaconda is built on. So when working with Anaconda, you
use the conda package manager for installing conda packages. ``pip``
can also be used with conda, but it's best to use use conda if you can.

We have made sure that every pacakge you need is available for conda.
We have made sure that every package you need is available for conda.

Setting up
..........
Expand Down Expand Up @@ -122,13 +122,21 @@ install a package, conda will first look in conda-forge, then NOAA-ORR-ERD, and
then in the default channel. This order should work well for PyGNOME. Be sure to add the channels in the order we specify. You can see what channels you have with::

> conda config --get channels
<<<<<<< HEAD
=======

It should return something like this::

--add channels 'defaults' # lowest priority
--add channels 'NOAA-ORR-ERD'
--add channels 'conda-forge' # highest priority
>>>>>>> develop

It should return something like this::

--add channels 'defaults' # lowest priority
--add channels 'conda-forge'
--add channels 'NOAA-ORR-ERD' # highest priority

conda environments
------------------
Expand Down Expand Up @@ -170,7 +178,11 @@ and kept separate from your main Anaconda install.
You will need to activate the environment any time you want to work with
``py_gnome`` in the future

<<<<<<< HEAD
**NOTE:** Again, if you are only using Python / Anaconda for GNOME, there is not reason to deal with the complications of environments.
=======
**NOTE:** Again, if you are only using Python / Anaconda for GNOME, it is not necessary to deal with the complications of environments.
>>>>>>> develop

Download GNOME
--------------
Expand All @@ -185,9 +197,19 @@ you can "clone" the git repository. If you clone the repository, you will
be able to update the code with the latest version with a simple command,
rather than having to re-download the whole package.

Downloading a single release
----------------------------

zip and tar archives of the PyGnome source code can be found here:

https://github.com/NOAA-ORR-ERD/PyGnome/releases

This will get you the entire source archive of a given release, which is a fine way to work with PyGnome. However, if you want to be able to quickly include changes as we update the code, you may want to work with a git "clone" of the source code instead.

Cloning the PyGNOME git repository
----------------------------------


git
...

Expand Down Expand Up @@ -266,7 +288,7 @@ If you want to use py_gnome with "real oil", rather than inert particles, you wi

https://github.com/NOAA-ORR-ERD/OilLibrary

This is under active development along with ``py_gnome``, so you are best off downloading the sources from gitHub and installing it from source -- similar to ``py_gnome``.
This is under active development along with ``py_gnome``, so you are best off downloading the sources from gitHub and installing it from source -- similar to ``py_gnome``. Though the lated releases of each should be compatible.

cloning the repository ::

Expand Down Expand Up @@ -308,10 +330,13 @@ Store.
[you may be able to install only the command line tools -- Apple keeps changing its mind]

After installing XCode, you still need to install the "Command Line
Tools". XCode includes a new "Downloads" preference pane to install
Tools". XCode includes a new "Downloads" preference pane to install
optional components such as command line tools, and previous iOS
Simulators.

**NOTE:** This may be slightly different on different versions of OS-X
and XCode -- google is your friend.

To install the XCode command line tools: - Start XCode from the
launchpad - Click the "XCode" dropdown menu button in the top left of
the screen near the Apple logo - Click "Preferences", then click
Expand Down Expand Up @@ -398,7 +423,7 @@ cleans files generated by the build as well as files auto-generated by
cython. It is a good idea to run ``cleanall`` after updating from the
gitHub repo -- particularly if strange errors are occurring.

You will need to re-run "develop" or "install" after running "cleanall"
You will need to re-run ``develop`` or ``install`` after running ``cleanall``

Testing ``py_gnome``
--------------------
Expand Down
34 changes: 15 additions & 19 deletions NormalInstall.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Installation in Development Mode
================================
Installation without conda / Anaconda
=====================================

Since this is development work, it might be good to create and run this
in a virtual environment. `Virtualenv <http://www.virtualenv.org/en/latest/>`__ and `Virtual envwrapper <http://virtualenvwrapper.readthedocs.org/en/latest/>`__ eases
Expand All @@ -12,42 +12,38 @@ may require a virtualenv in order to freely install python packages in
python's site-packages area. (site-packages is the standard place where
python installers will put packages after building them)

You may also want to consider using conda environments.
You may also want to consider using conda environments -- see above.

There is C++/Cython code that must be built - you will need the corect C compiler and recent setuptools, etc.
There is C++/Cython code that must be built - you will need the correct C compiler and recent setuptools, etc. See "Installing With Anaconda" for more detail.

python.org
==========

The following has been tested against `Python
2.7 <https://www.python.org/downloads/>`__

Linux (Tested in 32-bit, Ubuntu raring 13.04)
---------------------------------------------
Linux (Tested in 64-bit, CentOS)
--------------------------------

For Linux use appropriate package manager (apt-get on ubuntu) to
For Linux use appropriate package manager (yum on CentOS, apt-get on Ubuntu) to
download/install binary dependencies.


Binary Dependencies
...................

1. setuptools is required.
``> sudo apt-get install python-setuptools``
\` \`
2. `Pillow <http://pillow.readthedocs.org/en/latest/installation.html>`__
has binary dependencies. Visit the docs to get list of dependencies
for your system. Pillow requires Python's development libraries::

2. To compile Python extensions, you need the development libs for Python:

> sudo apt-get install python-dev

This did not build symlinks to libraries for me in /usr/lib, so had to manually create them::
3. netCDF4 python module requires NetCDF libraries:

> sudo ln -s /usr/lib/``\ uname
-i``-linux-gnu/libfreetype.so /usr/lib/`` ``> sudo ln -s /usr/lib/``\ uname
-i``-linux-gnu/libjpeg.so /usr/lib/`` ``> sudo ln -s /usr/lib/``\ uname
-i``-linux-gnu/libz.so /usr/lib/```` \`
libhdf5-serial-dev

3. netCDF4 python module requires NetCDF libraries: libhdf5-serial-dev,
libnetcdf-dev

4. The following python packages, documented in PyGnome's
Expand All @@ -56,6 +52,7 @@ This did not build symlinks to libraries for me in /usr/lib, so had to manually
Binaries for

`Numpy <http://packages.ubuntu.com/raring/python/python-numpy>`__ and

`Cython <http://packages.ubuntu.com/raring/python/cython>`__
can be installed using apt-get.

Expand All @@ -71,7 +68,6 @@ latest packages in your virtualenv once the above dependencies are met::
> pip install numpy
> pip install cython
> pip install netCDF4
> pip install Pillow

The remaining dependencies are python packages and can be installed using::

Expand Down Expand Up @@ -129,7 +125,7 @@ installed packages::

> pip

Usage:
Usage:
pip <command> [options]

Commands:
Expand Down Expand Up @@ -185,7 +181,7 @@ Build PyGnome

4. build the ``py_gnome`` module in develop mode first as install mode may
still need some testing/work.

The other option you may need is ``cleanall``, which should clean the development environment -- good to do after puling new code from git.

5. If this successfully completes, then run the unit tests::
Expand Down
6 changes: 6 additions & 0 deletions conda_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ colander>=1.2
sqlalchemy>=0.7.6
zope.interface>=4.1
zope.sqlalchemy>=0.7.6
<<<<<<< HEAD
gdal>=2.1.1
netCDF4=1.2.7
=======
hdf5=1.8.*
netCDF4=1.2.7
gdal>=2.1.1
>>>>>>> develop
awesome-slugify>=1.6
regex>=2014.12
unidecode>=0.04.19
Expand Down
Loading

0 comments on commit 2c3b665

Please sign in to comment.