Skip to content

Commit

Permalink
Merge pull request #78 from pysat/rc0.0.5
Browse files Browse the repository at this point in the history
RC v0.0.5
  • Loading branch information
aburrell authored Jun 10, 2022
2 parents b403a14 + ea66caa commit 5b2e757
Show file tree
Hide file tree
Showing 31 changed files with 1,472 additions and 829 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9"]
os: [ubuntu-latest, macos-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 @@ -42,10 +42,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
22 changes: 20 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"keywords": [
"pysat",
"ionosphere",
"atmosphere",
"thermosphere",
"magnetosphere",
"heliosphere",
"observations",
"space-weather",
"solar-index",
"geomagnetic-index",
"forecasts"
],
"creators": [
{
"affiliation": "U.S. Naval Research Laboratory",
Expand All @@ -11,17 +24,22 @@
"orcid": "0000-0001-8321-6074"
},
{
"affiliation": "The University of Texas at Dallas",
"affiliation": "Stoneris LLC",
"name": "Stoneback, Russell",
"orcid": "0000-0001-7216-4336"
},
},
{
"affiliation": "Predictive Science",
"name": "Pembroke, Asher"
},
{
"name": "Spence, Carey",
"orcid": "0000-0001-8340-5625"
},
{
"affiliation": "Goddard Space Flight Center",
"name": "Smith, Jonathon M.",
"orcid": "0000-0002-8191-4765"
}
]
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@ Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

[0.0.5] - 2022-06-10
--------------------
* Updated the docstrings to conform to pysat standards
* Added docstring tests to Flake8 portion of CI testing
* Fixed bug in `combine_kp` that occurs if no times are provided
* Improved unit test style and expanded unit test coverage
* Updated package organization documentation
* Added a function to normalize ACE SWEPAM variables as described in the OMNI
processing guide
* Deprecated `load_csv_data` method, which was moved to pysat
* Added the LASP predicted Dst to the Dst Instrument
* Updated pandas usage to remove existing deprecation warnings
* Updated `pysat.Instrument.load` calls to remove `use_header` deprecation
warning

[0.0.4] - 2021-05-19
--------------------
* New Logo
* Implements GitHub Actions for primary CI testing
* Updated tested python versions
* Removed non-document testing from Travis-CI and updated installation method
Expand Down
42 changes: 33 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Bug reports, feature suggestions and other contributions are greatly
appreciated! pysat and pysatSpaceWeather are community-driven projects 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
-------------

Expand Down Expand Up @@ -40,17 +45,26 @@ Development

To set up `pysatSpaceWeather` for local development:

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

2. Clone your fork locally:

```
git clone [email protected]:your_name_here/pysatSpaceWeather.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. Tests for custom functions should be added to the
performed automatically. See discussion
[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 in ``pysatSpaceWeather/tests``. For example,
space weather methods should be named
``pysatSpaceWeather/tests/test_methods_sw.py``. If no test file exists,
Expand All @@ -59,20 +73,28 @@ To set up `pysatSpaceWeather` for local development:
must begin with ``Test``, and test methods must also begin with ``test``.

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

```
pytest -vs pysatSpaceWeather
```

5. Update/add documentation (in ``docs``). Even if you don't think it's
relevant, check to see if any existing examples have changed.

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

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

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

Where CODE 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. Submit a pull request through the GitHub website. Pull requests should be
made to the ``develop`` branch.
Expand All @@ -87,8 +109,8 @@ For merging, you should:

1. Include an example for use
2. Add a note to ``CHANGELOG.md`` about the changes
3. Ensure that all checks passed (current checks include Travis-CI
and Coveralls) [1]_
3. Ensure that all checks passed (current checks include GitHub Actions,
Coveralls, and ReadTheDocs) [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
Expand Down Expand Up @@ -118,6 +140,8 @@ These include:
* `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
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# 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.
#
"""Configuration script for Sphinx documentation."""

import json
import os
import sys
Expand Down
Binary file modified docs/figures/pysatSpaceWeather.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion docs/supported_instruments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ The Disturbance Storm Time (Dst) Index is a measure of magnetic activity
associated with the ring current. The National Geophysical Data Center (NGDC)
maintains the
`current database <https://www.ngdc.noaa.gov/stp/geomag/dst.html>`_ from which
the Dst is downloaded. You can learn more about the Dst Index at the
the historic Dst is downloaded.
`LASP <https://lasp.colorado.edu/space_weather/dsttemerin/dsttemerin.html>`_
performs the calculates and provides the predicted Dst for the last 96 hours.
You can learn more about the Dst Index at the
`WDC Kyoto Observatory page <http://wdc.kugi.kyoto-u.ac.jp/dstdir/index.html>`_.


Expand Down
2 changes: 2 additions & 0 deletions pysatSpaceWeather/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Initialization file for pysatSpaceWeather module."""

import os

from pysatSpaceWeather import instruments # noqa F401
Expand Down
38 changes: 18 additions & 20 deletions pysatSpaceWeather/instruments/ace_epam.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""Supports ACE Electron, Proton, and Alpha Monitor data
"""Supports ACE Electron, Proton, and Alpha Monitor data.
Properties
----------
Expand All @@ -17,6 +17,8 @@
----
This is not the ACE scientific data set, which will be available at pysatNASA
Examples
--------
The real-time data is stored by generation date, where each file contains the
data for the current day. If you leave download dates empty, though, it will
grab today's file three times and assign dates from yesterday, today, and
Expand All @@ -42,6 +44,7 @@
import functools
import numpy as np

from pysat.instruments.methods.general import load_csv_data
from pysat import logger

from pysatSpaceWeather.instruments.methods import ace as mm_ace
Expand Down Expand Up @@ -74,11 +77,7 @@


def init(self):
"""Initializes the Instrument object with instrument specific values.
Runs once upon instantiation.
"""
"""Initialize the Instrument object with instrument specific values."""

# Set the appropriate acknowledgements and references
self.acknowledgements = mm_ace.acknowledgements()
Expand All @@ -90,7 +89,7 @@ def init(self):


def clean(self):
"""Routine to clean real-time ACE data using the status flag
"""Clean the real-time ACE data using the status flag.
Note
----
Expand Down Expand Up @@ -132,17 +131,17 @@ def clean(self):
list_files = functools.partial(mm_ace.list_files, name=name)


def load(fnames, tag=None, inst_id=None):
"""Load the ACE space weather prediction data
def load(fnames, tag='', inst_id=''):
"""Load the ACE space weather prediction data.
Parameters
----------
fnames : array-like
Series, list, or array of filenames
tag : str or NoneType
tag or None (default=None)
inst_id : str or NoneType
ACE instrument or None (default=None)
Series, list, or array of filenames.
tag : str
Instrument tag (default='').
inst_id : str
ACE instrument ID (default='').
Returns
-------
Expand All @@ -151,10 +150,9 @@ def load(fnames, tag=None, inst_id=None):
meta : pysat.Meta
Object containing metadata such as column names and units
Raises
------
ValueError
When unknown inst_id is supplied.
See Also
--------
pysat.instruments.methods.general.load_csv_data
Note
----
Expand All @@ -163,8 +161,8 @@ def load(fnames, tag=None, inst_id=None):
"""

# Save each file to the output DataFrame
data = mm_ace.load_csv_data(fnames, read_csv_kwargs={'index_col': 0,
'parse_dates': True})
data = load_csv_data(fnames, read_csv_kwargs={'index_col': 0,
'parse_dates': True})

# Assign the meta data
meta, status_desc = mm_ace.common_metadata()
Expand Down
Loading

0 comments on commit 5b2e757

Please sign in to comment.