Skip to content

Commit 2e15863

Browse files
author
Bill Ladwig
committed
Added misc notebooks
1 parent bd83bf9 commit 2e15863

4 files changed

Lines changed: 580 additions & 173 deletions

File tree

doc/source/contrib.rst

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ below.
113113
2. Follow the :ref:`fortranstyle`.
114114

115115
3. Please only submit routines relevant to WRF-Python (e.g. diagnostics,
116-
interpolation). General purpose climate/meteorology should go in the
116+
interpolation). General purpose climate/meteorology should go in to the
117117
SkyLab project (a project providing similar functionality as
118118
NCL).
119119

@@ -123,11 +123,11 @@ below.
123123
5. Place your code in the fortran/contrib directory in the WRF-Python
124124
source tree.
125125

126-
6. Document your code with a text file that has same name as your Fortran
126+
6. Document your code with a text file that has the same name as your Fortran
127127
file, but ending in .rst. This file should placed with your F90 code
128128
in the fortran/contrib directory. Your documentation can use
129129
restructured text formatting, or just plain text. This documentation
130-
will be used in the docstring when Python wrappers are made.
130+
will be used for the docstring when Python wrappers are made.
131131

132132
7. If you are unable to provide any type of test for your routine, please
133133
ensure that your documentation describes what your computation
@@ -138,8 +138,8 @@ below.
138138
Submitting Python Computational Routines
139139
---------------------------------------------
140140

141-
If you would like to submit a computational routine in Python, but don't know
142-
how to integrate it with the rest of WRF-Python's internals
141+
If you would like to submit a computational routine written in Python, but
142+
don't know how to integrate it with the rest of WRF-Python's internals
143143
(e.g. left indexing, arg checking, etc), feel free to
144144
submit the pure Python routine. Below is the guide for submitting pure
145145
Python routines.
@@ -170,30 +170,29 @@ Submitting Fully Wrapped Computational Routines
170170

171171
Submitting a fully wrapped computational routines is the fastest way to get
172172
your contributation released. However, it requires the most effort on your
173-
part. (This process will be simplified in the future, but it's a little
174-
tedious at this time).
173+
part.
175174

176175
1. Read the :ref:`internals` guide. This will show you how to wrap your
177176
routine.
178177

179178
2. Follow the :ref:`fortranstyle` and :ref:`pythonstyle`.
180179

181-
3. You should create your contribution in the WRF-Pyhon source tree as if
180+
3. You should create your contribution in the WRF-Python source tree as if
182181
you were one of the core developers of it. This means:
183182

184-
- Your Fortran code (if applicable) should be placed in the fortran
183+
- Your Fortran code (if applicable) should be placed in the *fortran*
185184
directory.
186185

187-
- Update the "ext1 = numpy.distutils.core.Extension" section of setup.py
186+
- Update the "ext1 = numpy.distutils.core.Extension" section of *setup.py*
188187
to include your new Fortran source (if applicable).
189188

190-
- Update extension.py to create the Python wrapper that calls your
189+
- Update *extension.py* to create the Python wrapper that calls your
191190
Fortran function. This must include the appropriate function decorators
192191
for handling argument checking, leftmost dimension indexing, etc. as
193192
described in :ref:`internals`.
194193

195194
- If the current function decorators do not cover your specific needs,
196-
place your custom decorator in specialdec.py. Most of the decorators
195+
place your custom decorator in *specialdec.py*. Most of the decorators
197196
in specialdec.py are used for products that contain multiple outputs like
198197
cape_2d, but you can use it for other purposes.
199198

@@ -212,18 +211,18 @@ tedious at this time).
212211

213212
- Decorate your getter routine with an appropriate metadata handling
214213
decorator. If you need to make a custom decorator for the metadata,
215-
place it in metadecorators.py.
214+
place it in *metadecorators.py*.
216215

217-
- Update the mappings in routines.py to map your diagnostic name to your
216+
- Update the mappings in *routines.py* to map your diagnostic name to your
218217
function, and to declare any keyword arguments that your function
219218
needs aside from the usual wrfin, varname, timeidx, method,
220219
squeeze, cache, and meta.
221220

222221
- If you would like to make your routine available as a raw computation,
223-
you will need to place an additional thin wrapper in computation.py. This
224-
thin wrapper must be decorated with an appropriate metadata decorator
225-
found in metadecorators.py (usually set_alg_metadata). If you need to
226-
write your own custom metadata decorator, write it in metadecorators.py.
222+
you will need to place an additional thin wrapper in *computation.py*.
223+
This thin wrapper must be decorated with an appropriate metadata decorator
224+
found in *metadecorators.py* (usually set_alg_metadata). If you need to
225+
write your own custom metadata decorator, write it in *metadecorators.py*.
227226

228227
- You must provide a docstring for every function you create using
229228
Google docstring format (see `Sphinx Napoleon <https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#google-vs-numpy>`_).
@@ -251,8 +250,8 @@ Creating New Examples
251250
1. Examples are made with Sphinx using restructured text.
252251

253252
2. Examples are currently found in the *doc* directory, mostly within the
254-
basic_usage.rst and plot.rst files. Feel free to contribute more examples
255-
to these files.
253+
*basic_usage.rst* and *plot.rst* files. Feel free to contribute more
254+
examples to these files.
256255

257256
3. Unless you are drastically changing the documentation structure, you can
258257
submit a pull request with your examples without creating a GitHub
@@ -379,8 +378,7 @@ whitespace characters in blank lines, etc.), try the
379378
Fortran Style Guide
380379
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
381380

382-
WRF-Python is a Fortran friendly project and we appreciate your contributions.
383-
However, we are only accepting Fortran 90 contributions, so you must
381+
At this time, we are only accepting Fortran 90 contributions, so you must
384382
convert any F77 code to F90 before contributing.
385383

386384
Although there is no formal style guide for Fortran contributions, Fortran
@@ -408,17 +406,17 @@ A summary of style notes is below:
408406
constants). All Fortran contributions must be threadsafe and have no side
409407
effects.
410408
- Place any computational constants in the wrf_constants module found in
411-
wrf_constants.f90 and put a "USE wrf_constants, ONLY : YOUR_CONSTANT"
409+
*wrf_constants.f90* and put a "USE wrf_constants, ONLY : YOUR_CONSTANT,..."
412410
declaration in your function.
413411
- Please do not redefine constants already declared in
414412
wrf_constants.f90 (e.g. G, RD, RV, etc). Although the WRF model itself
415413
does not adhere to this, we are trying to be consistent with the constants
416414
used throughout WRF-Python.
417-
- Do not put any STOP statements in your code to deal with errors. STOP
418-
statements will bring down the entire Python interpreter with it. Instead,
419-
add *errstat* and *errmsg* arguments to your function signature to tell
415+
- Do not put any STOP statements in your code to handle errors. STOP
416+
statements will bring the entire Python interpreter down with it. Instead,
417+
use *errstat* and *errmsg* arguments to your function signature to tell
420418
Python about the error so it can throw an exception. See WETBULBCALC
421-
in wrf_rip_phys_routines.f90 for how this is handled.
419+
in *wrf_rip_phys_routines.f90* for how this is handled.
422420
- If you know how to use OpenMP directives, feel free to add them to your
423421
routine, but this is not required.
424422

@@ -437,7 +435,7 @@ a basic suite of unit tests run.
437435
If your pull request is for a bug fix to an existing computational routine,
438436
then the automated unit tests will probably fail due to the new values. This
439437
is not a problem, but be sure to indicate to the developers in your GitHub
440-
issue that the unit tests will need to be updated.
438+
issue that the tests will need to be updated.
441439

442440
.. testing_::
443441

@@ -455,7 +453,7 @@ some recommendations below for how you can create your own tests.
455453
Sample Data
456454
^^^^^^^^^^^^^^^^^^^
457455

458-
You can download sample data for Hurricane Katrina here: <insert link>
456+
You can download sample data for Hurricane Katrina here: <contact developers>
459457
This data includes both a moving nest and a static nest version. You should
460458
create your tests with this data set (both static and moving nests), unless
461459
you are unable to reproduce a particular problem with it.
@@ -464,12 +462,12 @@ Supplying Data
464462
^^^^^^^^^^^^^^^^^^^^^^
465463

466464
If you need to supply us data for your test (due to a bug) please provide us a
467-
link to either a cloud storage service, by :ref:`submitting_files`, or some
468-
other means. Unless the data is very small, do not add it to the GitHub
465+
link to the file or upload it using :ref:`submitting_files`.
466+
Unless the data is very small, do not add it to the GitHub
469467
repository.
470468

471469
If you can demonstrate the problem/solution with a minimal set of hand created
472-
values, you can just use that in your test.
470+
values, then you can use that in your test.
473471

474472

475473
Guidelines
@@ -488,7 +486,7 @@ issue related to your contribution to discuss with developers.
488486
3. WRF-Python's tests were written using the standard *unittest* package,
489487
along with numpy's test package for the assert fuctions. One
490488
reason for this is that many of the tests are dynamically generated, and
491-
some other testing frameworks can't find the tests when generated this way.
489+
other testing frameworks can't find the tests when generated this way.
492490
If you need to use another test framework, that's fine, just let us know
493491
in your GitHub issue.
494492

0 commit comments

Comments
 (0)