Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Project Layout #1182

Merged
merged 17 commits into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins:
enabled: true
config:
test_patterns:
- "metpy/**/tests/*.py"
- "tests/*.py"
checks:
python:S3776:
enabled: false
Expand All @@ -34,5 +34,5 @@ plugins:
enabled: false

exclude_patterns:
- "metpy/io/_nexrad_msgs/msg*.py"
- "src/metpy/io/_nexrad_msgs/msg*.py"
- "docs/**/*"
7 changes: 3 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ coverage:
if_not_found: success
if_ci_failed: failure
paths:
- "metpy/(\w+/)?[^/]+\.py$"
- "src/metpy/.*"

tests:
target: 100%
paths:
- "metpy/.*/tests/.*"
- "metpy/tests/.*"
- "metpy/testing.py"
- "tests/.*"
- "src/metpy/testing.py"

notify:
gitter:
Expand Down
4 changes: 2 additions & 2 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
path_classifiers:
library:
- metpy/deprecation.py
- src/metpy/deprecation.py
test:
- exclude: metpy/testing.py
- exclude: src/metpy/testing.py
3 changes: 2 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ Kishan Mehta <kishan@mobifly.co.uk>
Matt Wilson <matthew.wilson@valpo.edu>
Andrew Huang <ahuang11@illinois.edu>
<ahuang11@illinois.edu> <huang.andrew12@gmail.com>
Andrew Huang <ahuang11@illinois.edu> Andrew <15331990+ahuang11@users.noreply.github.com>
<tsupinie@gmail.com> <tsupinie@ou.edu>
Tim Supinie <tsupinie@gmail.com>
Zach Bruick <zachary.bruick@valpo.edu>
Joy Monteiro <joy.merwin@gmail.com>
Steven Decker <sgdecker@envsci.rutgers.edu>
<sgdecker@envsci.rutgers.edu> <decker@envsci.rutgers.edu>
Claude Dicaire <31997745+eliteuser26@users.noreply.github.com>
Claude Dicaire <31997745+eliteuser26@users.noreply.github.com>
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ script:
export DOC_BUILD_RESULT=$?;
popd;
if [[ $TRAVIS_PYTHON_VERSION != 2.7 ]]; then
MPLBACKEND='agg' pytest --doctest-modules -k "not test" metpy;
PY_IGNORE_IMPORTMISMATCH=1 python -m pytest --doctest-modules -k "not test" src;
export DOC_TEST_RESULT=$?;
else
export DOC_TEST_RESULT=0;
fi;
doc8 README.rst docs/;
doc8 docs/;
if [[ $? -ne 0 || $DOC_BUILD_RESULT -ne 0 || $DOC_TEST_RESULT -ne 0 ]]; then
false;
fi;
Expand Down
4 changes: 2 additions & 2 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Kristen Pozsonyi
Leonardo Uieda
Lucas Sterzinger
Matt Wilson
Max Grover
Michael James
Nathan Wendt
Patrick Marsh
Expand All @@ -33,10 +34,9 @@ Stefan Hofer
Steven Decker
Tim Supinie
Tyler Wixtrom
Varden Nadkarni
Vardan Nadkarni
Warren Pettee
Will Holmgren
Zach Bruick
eliteuser26
kstilwell
mmorello1
23 changes: 16 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ upon submission of a Pull Request.
See [here](https://github.com/Unidata/MetPy/blob/master/CLA.md) for more
explanation and rationale behind MetPy's CLA.

## Source Code
MetPy's source code is located in the `src/` directory in the root of the repository. Within
`src/` is the `metpy/` directory, which is the base package. Inside here are the main
top-level subpackages of MetPy:
- `calc`: Calculations and tools
- `interpolate`: Interpolating data points to other locations
- `io`: Tools for reading and writing files
- `plots`: Plotting tools using Matplotlib (and Cartopy)

## Documentation
Now that you've made your awesome contribution, it's time to tell the world how to use it.
Writing documentation strings is really important to make sure others use your functionality
Expand All @@ -141,16 +150,16 @@ change the code and stay confident that things have not broken. Running the test
you made our default ``devel`` environment.

### Running Tests
Running the tests can be done by running ``py.test``
Running the tests can be done by running ``pytest``

Running the whole test suite isn't that slow, but can be a burden if you're working on just
one module or a specific test. It is easy to run tests on a single directory:

py.test metpy/calc
pytest tests/calc

A specific test can be run as:

py.test -k test_my_test_func_name
pytest -k test_my_test_func_name

### Writing Tests
Tests should ideally hit all of the lines of code added or changed. We have automated
Expand All @@ -169,7 +178,7 @@ purposes.)

I can see two easy tests here: one for the results as a float and one for the results as a
string. If I had added this to the ``calc`` module, I'd add those two tests in
``tests/test_calc.py``.
``tests/calc/test_calc.py``.

def test_add_as_float_or_string_defaults():
res = add_as_float_or_string(3, 4)
Expand All @@ -188,14 +197,14 @@ at the existing tests to get an idea of some of the common patterns.
Some tests (for matplotlib plotting code) are done as an image comparison, using the
pytest-mpl plugin. To run these tests, use:

py.test --mpl
pytest --mpl

When adding new image comparison tests, start by creating the baseline images for the tests:

py.test --mpl-generate-path=baseline
pytest --mpl-generate-path=baseline

That command runs the tests and saves the images in the ``baseline`` directory.
For MetPy this is generally ``metpy/plots/tests/baseline/``. We recommend using the ``-k`` flag
For MetPy this is generally ``tests/plots/baseline/``. We recommend using the ``-k`` flag
to run only the test you just created for this step.

For more information, see the [docs for pytest-mpl](https://github.com/astrofrog/pytest-mpl).
Expand Down
1 change: 0 additions & 1 deletion README

This file was deleted.

109 changes: 26 additions & 83 deletions README.rst → README.md
Original file line number Diff line number Diff line change
@@ -1,108 +1,55 @@
MetPy
=====

|License| |Gitter| |PRWelcome|
[![License](https://img.shields.io/pypi/l/metpy.svg)](https://pypi.python.org/pypi/MetPy/)
[![Gitter](https://badges.gitter.im/Unidata/MetPy.svg)](https://gitter.im/Unidata/MetPy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=round-square)](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

|Docs| |PyPI| |Conda|
[![Latest Docs](https://img.shields.io/badge/docs-stable-brightgreen.svg)](http://unidata.github.io/MetPy)
[![PyPI Package](https://img.shields.io/pypi/v/metpy.svg)](https://pypi.python.org/pypi/MetPy/)
[![Conda Package](https://anaconda.org/conda-forge/metpy/badges/version.svg)](https://anaconda.org/conda-forge/metpy)

|Travis| |AppVeyor| |CodeCov|
[![PyPI Downloads](https://img.shields.io/pypi/dm/metpy.svg)](https://pypi.python.org/pypi/MetPy/)
[![Conda Downloads](https://anaconda.org/conda-forge/metpy/badges/downloads.svg)](https://anaconda.org/conda-forge/metpy)

|Codacy| |CodeClimate| |Scrutinizer|

.. |License| image:: https://img.shields.io/pypi/l/metpy.svg
:target: https://pypi.python.org/pypi/MetPy/
:alt: License

.. |PyPI| image:: https://img.shields.io/pypi/v/metpy.svg
:target: https://pypi.python.org/pypi/MetPy/
:alt: PyPI Package

.. |PyPIDownloads| image:: https://img.shields.io/pypi/dm/metpy.svg
:target: https://pypi.python.org/pypi/MetPy/
:alt: PyPI Downloads

.. |Conda| image:: https://anaconda.org/conda-forge/metpy/badges/version.svg
:target: https://anaconda.org/conda-forge/metpy
:alt: Conda Package

.. |CondaDownloads| image:: https://anaconda.org/conda-forge/metpy/badges/downloads.svg
:target: https://anaconda.org/conda-forge/metpy
:alt: Conda Downloads

.. |Travis| image:: https://travis-ci.org/Unidata/MetPy.svg?branch=master
:target: https://travis-ci.org/Unidata/MetPy
:alt: Travis Build Status

.. |AppVeyor|
image:: https://ci.appveyor.com/api/projects/status/dwaletlb23v2ae4e/branch/master?svg=true
:target: https://ci.appveyor.com/project/Unidata/metpy/branch/master
:alt: AppVeyor Build Status

.. |CodeCov| image:: https://codecov.io/github/Unidata/MetPy/coverage.svg?branch=master
:target: https://codecov.io/github/Unidata/MetPy?branch=master
:alt: Code Coverage Status

.. |Codacy| image:: https://api.codacy.com/project/badge/Grade/e1ea0937eb4942e79a44bc9bb2de616d
:target: https://www.codacy.com/app/dopplershift/MetPy
:alt: Codacy issues

.. |CodeClimate| image:: https://codeclimate.com/github/Unidata/MetPy/badges/gpa.svg
:target: https://codeclimate.com/github/Unidata/MetPy
:alt: Code Climate

.. |Scrutinizer| image:: https://scrutinizer-ci.com/g/Unidata/MetPy/badges/quality-score.png?b=master
:target: https://scrutinizer-ci.com/g/Unidata/MetPy/?branch=master)
:alt: Scrutinizer Code Quality

.. |Docs| image:: https://img.shields.io/badge/docs-stable-brightgreen.svg
:target: http://unidata.github.io/MetPy
:alt: Latest Docs

.. |Gitter| image:: https://badges.gitter.im/Unidata/MetPy.svg
:target: https://gitter.im/Unidata/MetPy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
:alt: Gitter

.. |PRWelcome|
image:: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=round-square
:target: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
:alt: PRs Welcome
[![Travis Build Status](https://travis-ci.org/Unidata/MetPy.svg?branch=master)](https://travis-ci.org/Unidata/MetPy)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/dwaletlb23v2ae4e/branch/master?svg=true)](https://ci.appveyor.com/project/Unidata/metpy/branch/master)
[![Code Coverage Status](https://codecov.io/github/Unidata/MetPy/coverage.svg?branch=master)](https://codecov.io/github/Unidata/MetPy?branch=master)

[![Codacy issues](https://api.codacy.com/project/badge/Grade/e1ea0937eb4942e79a44bc9bb2de616d)](https://www.codacy.com/app/dopplershift/MetPy)
[![Code Climate](https://codeclimate.com/github/Unidata/MetPy/badges/gpa.svg)](https://codeclimate.com/github/Unidata/MetPy)

MetPy is a collection of tools in Python for reading, visualizing and
performing calculations with weather data.

MetPy follows `semantic versioning <https://semver.org>`_ in its version number. With our
MetPy follows [semantic versioning](https://semver.org) in its version number. With our
current 0.x version, that implies that MetPy's APIs (application programming interfaces) are
still evolving (we won't break things just for fun, but many things are still changing as we
work through design issues). Also, for a version `0.x.y`, we change `x` when we
release new features, and `y` when we make a release with only bug fixes.

For additional MetPy examples not included in this repository, please see the `Unidata Python
Gallery <https://unidata.github.io/python-gallery/>`_.
For additional MetPy examples not included in this repository, please see the [Unidata Python
Gallery](https://unidata.github.io/python-gallery/).

We support Python >= 3.6 and currently support Python 2.7.

NOTE: We are dropping support for Python 2.7 in Fall 2019. See
`here <https://github.com/Unidata/MetPy/blob/master/docs/installguide.rst>`_ for more
[here](https://github.com/Unidata/MetPy/blob/master/docs/installguide.rst) for more
information.

Need Help?
----------
Need help using MetPy? Found an issue? Have a feature request? Checkout our
`support page`__ .

__ https://github.com/Unidata/MetPy/blob/master/SUPPORT.md
[support page](https://github.com/Unidata/MetPy/blob/master/SUPPORT.md).

Important Links
---------------

- Source code repository: https://github.com/Unidata/MetPy
- HTML Documentation : http://unidata.github.io/MetPy
- Unidata Python Gallery: https://unidata.github.io/python-gallery/
- Issue tracker: http://github.com/Unidata/MetPy/issues
- "metpy" tagged questions on Stack Overflow: https://stackoverflow.com/questions/tagged/metpy
- Gitter chat room: https://gitter.im/Unidata/MetPy
- Say Thanks: https://saythanks.io/to/unidata
- [HTML Documentation](http://unidata.github.io/MetPy)
- [Unidata Python Gallery](https://unidata.github.io/python-gallery/)
- "metpy" tagged questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/metpy)
- [Gitter chat room](https://gitter.im/Unidata/MetPy)
- [Say Thanks!](https://saythanks.io/to/unidata)

Dependencies
------------
Expand All @@ -121,15 +68,13 @@ of the standard library enum module.
There is also an optional dependency on the pyproj library for geographic
projections (used with cross sections, grid spacing calculation, and the GiniFile interface).

See the `installation guide <https://unidata.github.io/MetPy/dev/installguide.html>`_
See the [installation guide](https://unidata.github.io/MetPy/dev/installguide.html)
for more information.

Code of Conduct
---------------
We want everyone to feel welcome to contribute to MetPy and participate in discussions. In that
spirit please have a look at our `code of conduct`__.

__ https://github.com/Unidata/MetPy/blob/master/CODE_OF_CONDUCT.md
spirit please have a look at our [Code of Conduct](https://github.com/Unidata/MetPy/blob/master/CODE_OF_CONDUCT.md).

Contributing
------------
Expand All @@ -151,9 +96,7 @@ includes giving feedback about the contribution process). Some of these contribu
the most valuable to the project as a whole, because you're coming to the project with fresh
eyes, so you can see the errors and assumptions that seasoned contributors have glossed over.

For more information, please read the see the `contributing guide`__.

__ https://github.com/Unidata/MetPy/blob/master/CONTRIBUTING.md
For more information, please read the see the [contributing guide](https://github.com/Unidata/MetPy/blob/master/CONTRIBUTING.md).

Philosophy
----------
Expand Down
2 changes: 1 addition & 1 deletion ci/gen_versions_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
import glob

with open('versions.json', 'wt') as version_file:
version_strings = ','.join('"{}"'.format(d) for d in glob.glob('v*.[0-9]*'))
version_strings = ','.join('"{}"'.format(d) for d in sorted(glob.glob('v*.[0-9]*')))
version_file.write('{"versions":["latest","dev",' + version_strings + ']}\n')
2 changes: 1 addition & 1 deletion docs/infrastructureguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To manage identifying the version of the code, MetPy relies upon `setuptools_scm
source from git tags and any additional commits. For development, the version will have a
string like ``0.10.0.post209+gff2e549f.d20190918``, which comes from ``git describe``. This
version means that the current code is 209 commits past the 0.10.0 tag, on git hash
``gff2e549f``, with local changes on top, last made on a date (indicated by ``d20190918``). For
``ff2e549f``, with local changes on top, last made on a date (indicated by ``d20190918``). For
a release, or non-git repo source dir, the version will just come from the most recent tag
(i.e. ``v0.10.0``).

Expand Down
2 changes: 1 addition & 1 deletion docs/installguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This includes:
* Core Python developers will
`stop support for Python 2.7 January 1, 2020 <https://pythonclock.org/>`_
* NumPy feature releases will be
`Python 3 only starting January 1, 2019 <https://www.numpy.org/neps/nep-0014-dropping-python2.7-proposal.html>`_,
`Python 3 only starting January 1, 2019 <https://numpy.org/neps/nep-0014-dropping-python2.7-proposal.html>`_,
and support for the last release supporting Python 2 will end January 1, 2020.
* XArray will drop
`2.7 January 1, 2019 as well <https://github.com/pydata/xarray/issues/1830>`_
Expand Down
5 changes: 0 additions & 5 deletions metpy/plots/colortable_files/test.tbl

This file was deleted.