Skip to content

Commit

Permalink
Merge pull request #117 from pysat/rc_0_0_3
Browse files Browse the repository at this point in the history
Release Candidate v0.0.3
  • Loading branch information
jklenzing authored May 18, 2022
2 parents 8ebbad6 + 115f19b commit d2ffb67
Show file tree
Hide file tree
Showing 47 changed files with 631 additions and 379 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up pysat
run: |
mkdir pysatData
python -c "import pysat; pysat.params['data_dirs'] = './pysatData'"
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"
- name: Check documentation build
run: sphinx-build -E -b html docs dist/docs
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9"]
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10"]
numpy_ver: [latest]
include:
- python-version: "3.7"
numpy_ver: "1.17"
- python-version: "3.8"
numpy_ver: "1.19"
os: ubuntu-latest

name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }}
Expand All @@ -29,7 +29,6 @@ jobs:

- name: Install standard dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test_requirements.txt
Expand All @@ -41,10 +40,10 @@ jobs:
- name: Set up pysat
run: |
mkdir pysatData
python -c "import pysat; pysat.params['data_dirs'] = './pysatData'"
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"
- name: Test PEP8 compliance
run: flake8 . --count --select=E,F,W --show-source --statistics
run: flake8 . --count --select=D,E,F,H,W --show-source --statistics

- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [0.0.3] - 2022-05-16
* Include flake8 linting of docstrings and style in Github Actions
* Include Windows tests in Github Actions
* Bug Fixes
* Expanded cleaning of ICON IVM ion drifts to more variables
* Fixed a bug in loading ICON IVM data (added multi_file_day = True)
* Fixed a bug where OMNI meta data float values are loaded as arrays
* Maintenance
* Removed dummy vars after importing instruments and constellations
* Updated NEP29 compliance in Github Actions
* Limit versions of hacking for improved pip compliance
* Update instrument template standards
* Updated documentation style
* Removed cap on cdflib

## [0.0.2] - 2021-06-07
* Updated Instruments and routines to conform with changes made for pysat 3.0
* Added documentation
Expand Down
142 changes: 85 additions & 57 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@
Contributing
============

Bug reports, feature suggestions and other contributions are greatly
Bug reports, feature suggestions, and other contributions are greatly
appreciated! pysat is a community-driven project and welcomes both feedback and
contributions.

Come join us on Slack! An invitation to the pysat workspace is available
in the 'About' section of the
[pysat GitHub Repository.](https://github.com/pysat/pysat) Development meetings
are generally held fortnightly.

Short version
-------------

* Submit bug reports and feature requests at `GitHub <https://github.com/pysat/pysatNASA/issues>`_
* Submit bug reports and feature requests at [GitHub](https://github.com/pysat/pysatNASA/issues)

* Make pull requests to the ``develop`` branch

Bug reports
-----------

When `reporting a bug <https://github.com/pysat/pysatNASA/issues>`_ please
When [reporting a bug](https://github.com/pysat/pysatNASA/issues) please
include:

* Your operating system name and version

* Any details about your local setup that might be helpful in troubleshooting

* Detailed steps to reproduce the bug

Feature requests and feedback
-----------------------------

The best way to send feedback is to file an issue at
`GitHub <https://github.com/pysat/pysatNASA/issues>`_.
[GitHub](https://github.com/pysat/pysatNASA/issues).

If you are proposing a feature:

* Explain in detail how it would work.

* Keep the scope as narrow as possible, to make it easier to implement.

* Remember that this is a volunteer-driven project, and that code contributions
are welcome :)

Expand All @@ -39,19 +49,24 @@ Development

To set up `pysatNASA` for local development:

1. `Fork pysatNASA on GitHub <https://github.com/pysat/pysatNASA/fork>`_.
2. Clone your fork locally::
1. [Fork pysatNASA on GitHub](https://github.com/pysat/pysatNASA/fork).

2. Clone your fork locally:

```
git clone [email protected]:your_name_here/pysatNASA.git
```

3. Create a branch for local development::
3. Create a branch for local development:

```
git checkout -b name-of-your-bugfix-or-feature
```

Now you can make your changes locally.

Tests for new instruments are performed automatically. See discussion
`here <https://pysat.readthedocs.io/en/main/new_instrument.html#testing-support>`_
[here](https://pysat.readthedocs.io/en/main/new_instrument.html#testing-support)
for more information on triggering these standard tests.

Tests for custom functions should be added to the appropriately named file
Expand All @@ -63,21 +78,32 @@ To set up `pysatNASA` for local development:


4. When you're done making changes, run all the checks to ensure that nothing
is broken on your local system, as well as check for flake8 compliance::
is broken on your local system, as well as check for flake8 compliance:

```
pytest -vs --flake8 pysatNASA
```

5. Update/add documentation (in ``docs``), if relevant

6. Add your name to the .zenodo.json file as an author

7. Commit your changes and push your branch to GitHub::

git add .
git commit -m "Brief description of your changes"
git push origin name-of-your-bugfix-or-feature

8. Submit a pull request through the GitHub website. Pull requests should be
7. Commit your changes:
```
git add .
git commit -m "AAA: Brief description of your changes"
```
Where AAA is a standard shorthand for the type of change (eg, BUG or DOC).
`pysat` follows the [numpy development workflow](https://numpy.org/doc/stable/dev/development_workflow.html),
see the discussion there for a full list of this shorthand notation.

8. Once you are happy with the local changes, push to Github:
```
git push origin name-of-your-bugfix-or-feature
```
Note that each push will trigger the Continuous Integration workflow.

9. Submit a pull request through the GitHub website. Pull requests should be
made to the ``develop`` branch.

Pull Request Guidelines
Expand All @@ -91,44 +117,46 @@ For merging, you should:
1. Include an example for use
2. Add a note to ``CHANGELOG.md`` about the changes
3. Update the author list in ``zenodo.json`` if applicable
4. Ensure that all checks passed (current checks include Travis-CI (pytest and
flake8) and Coveralls) [1]_

.. [1] If you don't have all the necessary Python versions available locally or
have trouble building all the testing environments, you can rely on
Travis to run the tests for each change you add in the pull request.
Because testing here will delay tests by other developers, please ensure
that the code passes all tests on your local system first.

Project Style Guidelines
------------------------

In general, pysat follows PEP8 and numpydoc guidelines. Pytest runs the unit
and integration tests, flake8 checks for style, and sphinx-build performs
documentation tests. However, there are certain additional style elements that
have been adopted to ensure the project maintains a consistent coding style.
These include:

* Line breaks should occur before a binary operator (ignoring flake8 W503)
* Combine long strings using `join`
* Preferably break long lines on open parentheses rather than using `\`
* Use no more than 80 characters per line
* Avoid using Instrument class key attribute names as unrelated variable names:
`platform`, `name`, `tag`, and `inst_id`
* The pysat logger is imported into each sub-module and provides status updates
at the info and warning levels (as appropriate)
* Several dependent packages have common nicknames, including::
* `import datetime as dt`
* `import numpy as np`
* `import pandas as pds`
* `import xarray as xr`
* All classes should have `__repr__` and `__str__` functions
* Docstrings use `Note` instead of `Notes`
* Try to avoid creating a try/except statement where except passes
* Use setup and teardown in test classes
* Use pytest parametrize in test classes when appropriate
* Provide testing class methods with informative failure statements and
descriptive, one-line docstrings
* Block and inline comments should use proper English grammar and punctuation
with the exception of single sentences in a block, which may then omit the
final period
4. Ensure that all checks passed (current checks include Github Actions and Coveralls)

If you don't have all the necessary Python versions available locally or
have trouble building all the testing environments, you can rely on
GitHub Actions to run the tests for each change you add in the pull
request. Because testing here will delay tests by other developers,
please ensure that the code passes all tests on your local system first.


Project Style Guidelines
------------------------

In general, pysat follows PEP8 and numpydoc guidelines. Pytest runs the unit
and integration tests, flake8 checks for style, and sphinx-build performs
documentation tests. However, there are certain additional style elements that
have been adopted to ensure the project maintains a consistent coding style.
These include:

* Line breaks should occur before a binary operator (ignoring flake8 W503)
* Combine long strings using `join`
* Preferably break long lines on open parentheses rather than using `\`
* Use no more than 80 characters per line
* Avoid using Instrument class key attribute names as unrelated variable names:
`platform`, `name`, `tag`, and `inst_id`
* The pysat logger is imported into each sub-module and provides status updates
at the info and warning levels (as appropriate)
* Several dependent packages have common nicknames, including:
* `import datetime as dt`
* `import numpy as np`
* `import pandas as pds`
* `import xarray as xr`
* When incrementing a timestamp, use `dt.timedelta` instead of `pds.DateOffset`
when possible to reduce program runtime
* All classes should have `__repr__` and `__str__` functions
* Docstrings use `Note` instead of `Notes`
* Try to avoid creating a try/except statement where except passes
* Use setup and teardown in test classes
* Use pytest parametrize in test classes when appropriate
* Provide testing class methods with informative failure statements and
descriptive, one-line docstrings
* Block and inline comments should use proper English grammar and punctuation
with the exception of single sentences in a block, which may then omit the
final period
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ Another way to use the instruments in an external repository is to register the
```
import pysat
pysat.utils.registry.register('pysatNASA.instruments.icon_ivm')
pysat.utils.registry.register(['pysatNASA.instruments.icon_ivm'])
ivm = pysat.Instrument('icon', 'ivm', inst_id='a')
```
24 changes: 8 additions & 16 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# -*- coding: utf-8 -*-
#
# pysatNASA documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 5 16:25:26 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
"""Configuration file for the Sphinx documentation builder.
Note
----
For a full list see the documentation:
https://www.sphinx-doc.org/en/master/config
"""

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import json
import os
import sys
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/ex_init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Meter on board the Ionospheric CONnection Explorer `(ICON) <https://www.nasa.gov
import datetime as dt
import pysat
import pysatNASA as py_nasa
pysat.utils.registry.register_by_module(py_nasa.instruments)

pysat.utils.registry.register_by_module(py_nasa.instruments)

old_time = dt.datetime(2020, 1, 1)
ivm = pysat.Instrument(platform='icon', name='ivm',
Expand Down
28 changes: 26 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Python 3.7+ and pysat 3.0.0+.
================ =================
Common modules Community modules
================ =================
beautifulsoup4 cdflib
lxml pysat
beautifulsoup4 cdflib>=0.4.4
lxml pysat>=3.0.0
netCDF4
numpy
pandas
Expand Down Expand Up @@ -55,3 +55,27 @@ Installation Options


python setup.py develop --user

.. _post-install:

Post Installation
-----------------

After installation, you may register the :py:mod:`pysatNASA`
:py:class:`Instrument` sub-modules with pysat. If this is your first time using
pysat, check out the `quickstart guide
<https://pysat.readthedocs.io/en/latest/quickstart.html>`_ for pysat. Once pysat
is set up, you may choose to register the the :py:mod:`pysatNASA`
:py:class:`Instruments` sub-modules by:

.. code:: python
import pysat
import pysatNASA
pysat.utils.registry.register_by_module(pysatNASA.instruments)
You may then use the pysat :py:attr:`platform` and :py:attr:`name` keywords to
initialize the model :py:class:`Instrument` instead of the
:py:attr:`inst_module` keyword argument.
8 changes: 8 additions & 0 deletions pysatNASA/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""Core library for pysatNASA.
This is a library of `pysat` instrument modules and methods designed to support
NASA instruments and missions archived at the Community Data Analysis Web
portal.
"""

import os
from pysatNASA import constellations # noqa F401
from pysatNASA import instruments # noqa F401
Expand Down
10 changes: 10 additions & 0 deletions pysatNASA/constellations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
"""Interface for pysatNASA to manage and analyze multiple pysat instruments.
Each instrument is contained within a subpackage of the pysatNASA.instruments
package.
"""


__all__ = ['de2', 'icon']

for const in __all__:
exec("from pysatNASA.constellations import {:}".format(const))

# Remove dummy variable
del const
Loading

0 comments on commit d2ffb67

Please sign in to comment.