This contributor guide is written for wrf-python v1.3.x. In the
not-too-distant future, wrf-python will undergo a significant refactoring
to remove the wrapt decorators (which don't serialize for dask), but the
concepts will remain similar to what is described in :ref:`internals`.
Introduction
-----------------------------
@ -30,10 +22,6 @@ The source code is available on GitHub:
@@ -30,10 +22,6 @@ The source code is available on GitHub:
https://github.com/NCAR/wrf-python
To checkout the code::
git clone https://github.com/NCAR/wrf-python
Git Flow
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -66,11 +54,14 @@ Users are encouraged to contribute various ways. This includes:
@@ -66,11 +54,14 @@ Users are encouraged to contribute various ways. This includes:
- Creating new examples in the documentation (e.g. plotting examples)
Ground Rules
------------------------------
Please follow the code of conduct.
Please follow the `Code of Conduct <https://github.com/ncar/wrf-python>`_.
- Please create an issue on GitHub for any pull request you wish to submit,
except for documentation issues.
- Each pull request should be for a logical collection of changes. You can
submit multiple bug fixes in a single pull request if the bugs are related.
Otherwise, please submit seperate pull requests.
@ -109,6 +100,164 @@ create an account on GitHub to submit a report.
@@ -109,6 +100,164 @@ create an account on GitHub to submit a report.
See :ref:`submitting_files`.
Submitting Fortran Computational Routines
--------------------------------------------
If you have Fortran computational routines that you'd like to contribute,
but don't know how to wrap them in to Python, please follow the instructions
below.
1. Only Fortran 90 code will be accepted, so please port your F77 code to
F90.
2. Follow the :ref:`fortranstyle`.
3. Please only submit routines relevant to WRF-Python (e.g. diagnostics,
interpolation). General purpose climate/meteorology should go in the
SkyLab project (a project providing similar functionality as
NCL).
4. If you are unsure if you should contribute your Fortran code, make an
issue on GitHub and we can begin a discussion there.
5. Place your code in the fortran/contrib directory in the WRF-Python
source tree.
6. Document your code with a text file that has same name as your Fortran
file, but ending in .rst. This file should placed with your F90 code
in the fortran/contrib directory. Your documentation can use
restructured text formatting, or just plain text. This documentation
will be used in the docstring when Python wrappers are made.
7. If you are unable to provide any type of test for your routine, please
ensure that your documentation describes what your computation
should produce. You can submit auxiallary documentation and/or images for
this purpose if needed.
Submitting Python Computational Routines
---------------------------------------------
If you would like to submit a computational routine in Python, but don't know
how to integrate it with the rest of WRF-Python's internals
(e.g. left indexing, arg checking, etc), feel free to
submit the pure Python routine. Below is the guide for submitting pure
Python routines.
1. These routines should be placed in src/wrf/contrib.py. These algorithms
will not be imported in to WRF-Python's default namespace.
2. Follow the :ref:`pythonstyle`.
2. Write your computation as dimension unaware as possible. For example,
adding pressure and perturbation pressure is simply P + PB.
3. If dimensionality is needed, then write for the minimum dimensionality
required to make the computation for one time step (if applicable). For
example, if you're computing CAPE, then you should use three dimensions for
your algorithm, and we will handle the looping over all times.
4. Document your routine by creating a docstring that follows Google docstring
format (see `Sphinx Napoleon <https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#google-vs-numpy>`_).
5. If you are unable to provide a test for this function, please provide
additional documentation (or images) to show what this function should