Skip to content

Commit

Permalink
Merge pull request #22 from jdavid/master
Browse files Browse the repository at this point in the history
Plotting and docs
  • Loading branch information
FrancescAlted committed Feb 24, 2017
2 parents 2347268 + 978992b commit 0a24fb9
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 629 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ doc/build/*
f2py_build/f90/*
FortFlex.so
.idea/*

/.cache/
.*.swp
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ install:
# Install dependencies in conda
- conda create -n reflex_env python=$TRAVIS_PYTHON_VERSION libgfortran
- source activate reflex_env
- conda install pyqt # seems required when running matplotlib
# Install the remaining requeriments
- cat requirements.txt | xargs conda install
- conda install --file requirements.txt -c conda-forge

# Install dependencies in PyPI
- pip install pytest-cov coveralls
Expand Down
86 changes: 45 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ will have the option to save this converted output for later use.

Initially we aim to provide:

a. an interface to read model output and provide general information about the simulation
b. tools for simple access to the data
c. simple visualization tools

- an interface to read model output and provide general information about the simulation
- tools for simple access to the data
- simple visualization tools

Some routines were initially created to work with FLEXPART model
ouput. [FLEXPART](http://transport.nilu.no/flexpart) is a Lagrangian particle
Expand All @@ -49,25 +48,37 @@ As for Issues, please use the
[tool](https://github.com/spectraphilic/reflexible/issues) at
github.

Direct inquiries may be sent to::
Direct inquiries may be sent to:

John F Burkhart, University of Oslo
[john.burkhart](mailto://john.burkhart@geo.uio.no)

## Web Resources ##
## Sphinx Documentation

### GitHub ###
The documentation is hosted at
[readthedocs](http://reflexible.readthedocs.org/en/latest/index.html).

Clone the github repository into a folder in your PYTHONPATH::
## Working with reflexible

$ git clone https://github.com/spectraphilic/reflexible.git
Clone the github repository into a folder in your PYTHONPATH:

### Sphinx Documentation ###
$ git clone https://github.com/spectraphilic/reflexible.git

The documentation is hosted at
[readthedocs](http://reflexible.readthedocs.org/en/latest/index.html).
Install the requirements:

## Working with reflexible
$ conda install --file requirements.txt -c conda-forge

Now compile the library:

$ python setup.py build_ext --inplace

This will compile the pflexcy.pyx file into a pflexcy.so module that
can be imported and used by the pf.readgrid function. A series of
tests are run to try and determine the best module to use -- somewhat
transparently to the user. See the reflexible.readgridV8 function for
more information.

### Possible issues

There are a few 'gotchas' when using the module. First, you will
likely have to recompile (f2py) the FortFlex.f file and create a
Expand All @@ -78,15 +89,7 @@ an issue.
An alternative 'BinaryFile' class has been created so one can work
with pure Python. Alone, it is significantly slower than the FortFlex
module, however, if you use the dumpgrid module, significant speedups
can be achieved. For this run::

$ python setup.py build_ext --inplace

This will compile the pflexcy.pyx file into a pflexcy.so module that
can be imported and used by the pf.readgrid function. A series of
tests are run to try and determine the best module to use -- somewhat
transparently to the user. See the reflexible.readgridV8 function for
more information.
can be achieved.

Primary functionality comes from the readheaderV8 function and the
readgridV8 function. I have created a "Header" class that can be used
Expand All @@ -99,24 +102,24 @@ documentation.

reflexible comes with a suite of test units that you can run in a
series of ways after you compiled the extensions and before you
install it::
install it:

$ PYTHONPATH=. python -c "import reflexible; reflexible.test()"
$ PYTHONPATH=. python -c "import reflexible; reflexible.test()"

or::
or:

$ PYTHONPATH=. python reflexible/tests/all.py
$ PYTHONPATH=. python reflexible/tests/all.py

or using the excellent py.test (recommended for developers)::
or using the excellent py.test (recommended for developers):

$ PYTHONPATH=. py.test
$ py.test

## Installation

If all is working correctly, then you can install it (you might need
to be superuser here)::
to be superuser here):

$ python setup.py install
$ python setup.py install

And *hopefully* everything works!.

Expand All @@ -125,17 +128,18 @@ And *hopefully* everything works!.
When you run into problems it is always nice that when you are filing
a ticket you would add the information about the versions you are
using. You can do that via the `pf.print_versions()`. Here it is an
output example::

$ python -c "import reflexible; reflexible.print_versions()"
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
reflexible version: 0.10.0
NumPy version: 1.9.0
Python version: 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
Platform: linux2-x86_64
Byte-ordering: little
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
output example:

$ python -c "import reflexible; reflexible.print_versions()"
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
reflexible version: 0.5.0
NumPy version: 1.12.0
Python version: 3.5.3 | packaged by conda-forge | (default, Feb 9 2017, 14:37:12)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]
Platform: linux-x86_64
Byte-ordering: little
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


## Key Tools

Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ the 0th element is the Total Column.

Using the plotting tools of reflexible we can plot the total column easily::

In [61]: rf.plot_totalcolumn(H, myc.total_column, map_region='NorthAtlantic')
In [61]: rf.plot_totalcolumn(H, myc, map_region='NorthAtlantic')

.. TODO: The above line does not work yet for the stads2 dataset. Why?
Expand Down
4 changes: 4 additions & 0 deletions doc/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ the git repository::

$ git clone https://github.com/spectraphilic/reflexible.git

Install the requirements:

$ conda install --file requirements.txt -c conda-forge

Build and test
==============

Expand Down
Loading

0 comments on commit 0a24fb9

Please sign in to comment.