Skip to content

Commit

Permalink
Created basic contributor guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Hallock committed Jan 23, 2020
1 parent 0155430 commit a1156ac
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Porting NCL example scripts to Python
=====================================
0. Clone this repository and create a conda environment containing all of the software necessary to build this examples gallery webpage: [installation instructions](INSTALLATION.md)

1. Select an NCL script from the NCL documentation website: http://ncl.ucar.edu/Applications/

Check the `Plots` directory of this repository to ensure the example you are about to work on has not been ported yet.

2. Determine if any critical NCL computational functions are missing. If so, please submit an issue on this repository's GitHub page containing the script name and function name, select a new NCL script, and start this process over.

3. Create a new Python script using the original NCL script's basename, but prepended with "NCL_". For example:
`new_script_1.ncl` becomes `NCL_new_script_1.py`

* Note that `template_script.py` at the root of this repository is a great starting point for a new script, so you may want to consider copying that to `NCL_new_script_1.py` instead of starting from scratch.


4. The general objective of this project is to identify any NCL plotting functionality that is missing from the popular Matplotlib + Cartopy toolchain, so each contributed script should contain a best-effort attempt at reproducing an NCL graphic as closely as possible without using NCL or PyNGL. In the future, PyNGL examples may be included in this repository as well, but the current goal is to see what *can't* be done with Matplotlib and Cartopy.

That said, if you identify any NCL functionality in particular that does not seem to exist in Matplotlib/Cartopy, please create an issue on this repository's GitHub page with a link to the original NCL example page and list any NCL functions whose functionality is missing from Python.

5. When you have completed an example script, please try building the sphinx documentation from this repository using "make html" from the repository's root directory. Then open the HTML file located at `_build/html/auto_examples/index.html` and try to find your new example, ensuring that any output (text or graphical) matches what you expected.

6. Submit an Pull Request on this repository's GitHub page containing your new example. Please add a link to the original NCL script from the NCL documentation site. Also, please consider adding a brief summary of your experience porting the script. If it was easy, say so; if it was very hacky and required 7 times as many lines of code as the NCL script, please say that.

https://github.com/Unidata/python-training/blob/master/pages/contributing.md
8 changes: 8 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Installation
============

Create a GeoCAT-examples Conda environment
------------------------------------------
conda create -f conda_environment.yml -n geocat-examples
conda activate geocat-examples

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
GeoCAT-examples
===============
Future home of the GeoCAT-examples repository!

The goal of this repository will be to provide Python implementations of NCL scripts from the [NCL Application Examples website](https://ncl.ucar.edu/Applications/).

Check out our (work-in-progress) [examples gallery](https://geocat-examples.readthedocs.io/en/latest/)!

Contributing
============
Please read our [contributor guide](CONTRIBUTING.md) for more information on how to contribute to this project.
12 changes: 12 additions & 0 deletions conda_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: geocat-examples
channels:
- conda-forge
- ncar
dependencies:
- python=3
- geocat-comp
- netcdf4
- cartopy
- matplotlib
- sphinx-gallery
- sphinx_rtd_theme
27 changes: 27 additions & 0 deletions template_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
example_name.py
===============
Text description of the example
Consider linking to the NCL documentation here
"""

###############################################################################
# A line beginning with at least 20 '#' characters indicates that all of the
# following comment lines should be interpreted as a markdown cell when the
# script is converted to a Jupyter Notebook.
print("This is a code cell")


###############################################################################
# Another text/markdown cell
print("More code")
# This line will be a comment inside a code cell, *NOT* a markdown cell
print("Even more code")


###############################################################################
# Note the inline comment in the previous code cell. This was not converted to
# its own markdown cell because it was not contiguously preceeded with a
# comment line beginning with 20+ '#' characters.

0 comments on commit a1156ac

Please sign in to comment.