Skip to content

Commit

Permalink
Merge pull request #149 from pysat/v0.0.2rc
Browse files Browse the repository at this point in the history
Version 0.0.2 Release Candidate
  • Loading branch information
aburrell authored Aug 30, 2024
2 parents 597c91e + 040e9c4 commit 9976fa8
Show file tree
Hide file tree
Showing 39 changed files with 830 additions and 476 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12"]
numpy_ver: ["latest"]
test_config: ["latest"]
include:
# NEP29 compliance settings
- python-version: "3.9"
numpy_ver: "1.23"
- python-version: "3.10"
numpy_ver: "1.24"
os: ubuntu-latest
test_config: "NEP29"
# Operational compliance settings
Expand Down Expand Up @@ -70,22 +70,25 @@ jobs:
run: flake8 . --count --exit-zero --max-complexity=10 --statistics

- name: Test with pytest
run: pytest
run: pytest --cov=pysatSpaceWeather --cov-report xml

- name: Publish results to coveralls
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COVERALLS_PARALLEL: true
run: coveralls --rcfile=pyproject.toml --service=github
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run=${{ join(matrix.*, '-') }}
parallel: true
format: cobertura
debug: true

finish:
name: Finish Coverage Analysis
needs: build
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install --upgrade coveralls
coveralls --service=github --finish
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
28 changes: 22 additions & 6 deletions .github/workflows/pysat_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.11"]
python-version: ["3.12"]

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -35,9 +35,25 @@ jobs:
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"
- name: Test with pytest
run: pytest
run: pytest --cov=pysatSpaceWeather --cov-report xml

- name: Publish results to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --rcfile=setup.cfg --service=github
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run=${{ join(matrix.*, '-') }}
parallel: true
format: cobertura
debug: true

finish:
name: Finish Coverage Analysis
needs: build
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"orcid": "0000-0001-8321-6074"
},
{
"affiliation": "Stoneris LLC",
"affiliation": "Cosmic Studio",
"name": "Stoneback, Russell",
"orcid": "0000-0001-7216-4336"
},
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

[0.2.0] - 2024-08-30
--------------------
* Enhancements
* Added an instrument for the daily Nobeyama Radio Polarimeters solar flux
* Maintenance
* Removed unneeded keyword arguments from Kp method functions
* Replaces `fillna` with `asfreq` to maintain the same behaviour
* Implemented `iloc` in pandas Series and DataFrame index access
* Added `verify=False` to GFZ requests
* Updated documentation links and fixed intersphinx mapping
* Replaced `utcnow` with `now` and the UTC timezone
* Removed support for deprecated Kp tag, ''
* Updated minimum supported pysat version to 3.2.0+.
* Bugs
* Fixed errors introduced by assuming files will be present when combining
F10.7 or Kp data in `combine_f107` and `combine_kp` functions.

[0.1.0] - 2024-02-16
--------------------
* Enhancements
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Python 3.7+.

| Common modules | Community modules |
| -------------- | ----------------- |
| netCDF4 | pysat >= 3.1.0 |
| netCDF4 | pysat >= 3.2.0 |
| numpy | |
| pandas | |
| requests | |
Expand Down
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
author = ', '.join([auth['name'] for auth in zenodo['creators']])
description = 'Tools for space weather indices.'
category = 'Space Physics'
copyright = ', '.join(['2022', author])
copyright = ', '.join(['2024', author])

# The short X.Y version
version = info.project['version'].base_version
Expand Down Expand Up @@ -177,8 +177,9 @@
epub_exclude_files = ['search.html']

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'<name>': ('https://docs.python.org/', None)}

# Links to ignore when checking for stability
linkcheck_ignore = ['https://lasp.colorado.edu/space_weather/dsttemerin/',
'https://*QUERY']
'https://*QUERY',
'https://datapub.gfz-potsdam.de/download/10.5880.Kp.0001/*']
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Python 3.6 and 3.9+.
============== =================
Common modules Community modules
============== =================
netCDF4 pysat >= 3.1.0
netCDF4 pysat >= 3.2.0
numpy
pandas
requests
Expand Down
31 changes: 27 additions & 4 deletions docs/supported_instruments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,30 @@ Supports ACE Solar Wind Electron Proton Alpha Monitor data.
:members:


.. _norp-inst:
NoRP
----

The Nobeyama Radio Polarameters (NoRP) platform encompasses solar flux
measurements provided by the Japanese Solar Science Observatory.
`NoRP <https://solar.nro.nao.ac.jp/norp/index.html>`_ provides
additional information and processing tools on their website.

.. _norp-rf-inst:

RF
^^^

RF is the radio flux measured from the sun at different wavelengths. This
provides a different measure of solar activity and has been corrected to be
in solar flux units at 1 AU. The daily data set currently starts in Nov 1951
and is updated to extend to the current period, but not in real-time.


.. automodule:: pysatSpaceWeather.instruments.norp_rf
:members:


.. _sw-inst:
SW
---
Expand Down Expand Up @@ -179,10 +203,9 @@ Dst
^^^

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 historic Dst is downloaded.
associated with the ring current. The National Centers for Environmental
Information (NCEI), formerly the National Geophysical Data Center (NGDC),
maintains the current database from which 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
Expand Down
9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pysatSpaceWeather"
version = "0.1.0"
version = "0.2.0"
description = 'pysat support for Space Weather Indices'
readme = "README.md"
requires-python = ">=3.6"
Expand All @@ -22,7 +22,6 @@ classifiers = [
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -44,13 +43,12 @@ dependencies = [
"numpy",
"packaging",
"pandas",
"pysat>=3.1.0",
"pysat>=3.2.0",
"requests",
"xarray"]

[project.optional-dependencies]
test = [
"coveralls < 3.3",
"flake8",
"flake8-docstrings",
"hacking >= 1.0",
Expand All @@ -65,7 +63,7 @@ doc = [
"numpydoc",
"pyproject_parser",
"sphinx",
"sphinx_rtd_theme >= 1.2.2,<2.0.0"
"sphinx_rtd_theme >= 1.2.2, < 2.0.0"
]

[project.urls]
Expand All @@ -75,7 +73,6 @@ Source = "https://github.com/pysat/pysatSpaceWeather"
[tool.coverage.report]

[tool.pytest.ini_options]
addopts = "--cov=pysatSpaceWeather"
markers = [
"all_inst",
"download",
Expand Down
8 changes: 4 additions & 4 deletions pysatSpaceWeather/instruments/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pysatSpaceWeather.instruments import methods # noqa F401

__all__ = ['ace_epam', 'ace_mag', 'ace_sis', 'ace_swepam', 'sw_ae', 'sw_al',
'sw_au', 'sw_ap', 'sw_apo', 'sw_cp', 'sw_dst', 'sw_f107', 'sw_flare',
'sw_hpo', 'sw_kp', 'sw_mgii', 'sw_polarcap', 'sw_sbfield', 'sw_ssn',
'sw_stormprob']
__all__ = ['ace_epam', 'ace_mag', 'ace_sis', 'ace_swepam', 'norp_rf', 'sw_ae',
'sw_al', 'sw_au', 'sw_ap', 'sw_apo', 'sw_cp', 'sw_dst', 'sw_f107',
'sw_flare', 'sw_hpo', 'sw_kp', 'sw_mgii', 'sw_polarcap',
'sw_sbfield', 'sw_ssn', 'sw_stormprob']

for inst in __all__:
exec("from pysatSpaceWeather.instruments import {inst}".format(inst=inst))
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/ace_epam.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/ace_mag.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down
8 changes: 5 additions & 3 deletions pysatSpaceWeather/instruments/ace_sis.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down Expand Up @@ -115,8 +115,10 @@ def clean(self):

# Evaluate the different proton fluxes. Replace bad values with NaN and
# times with no valid data
self.data['int_pflux_10MeV'][self.data['status_10'] > max_status] = np.nan
self.data['int_pflux_30MeV'][self.data['status_30'] > max_status] = np.nan
self.data['int_pflux_10MeV'] = self.data['int_pflux_10MeV'].where(
(self.data['status_10'] <= max_status), other=np.nan)
self.data['int_pflux_30MeV'] = self.data['int_pflux_30MeV'].where(
(self.data['status_30'] <= max_status), other=np.nan)

eval_cols = ['int_pflux_10MeV', 'int_pflux_30MeV']

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/ace_swepam.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
inst_ids = {inst_id: [tag for tag in tags.keys()] for inst_id in ['']}

# Define today's date
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# ----------------------------------------------------------------------------
# Instrument test attributes
Expand Down
1 change: 1 addition & 0 deletions pysatSpaceWeather/instruments/methods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pysatSpaceWeather.instruments.methods import f107 # noqa F401
from pysatSpaceWeather.instruments.methods import general # noqa F401
from pysatSpaceWeather.instruments.methods import gfz # noqa F401
from pysatSpaceWeather.instruments.methods import norp # noqa F401
from pysatSpaceWeather.instruments.methods import kp_ap # noqa F401
from pysatSpaceWeather.instruments.methods import lasp # noqa F401
from pysatSpaceWeather.instruments.methods import lisird # noqa F401
Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/instruments/methods/ace.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def download(date_array, name, tag='', inst_id='', data_path='', now=None,
"""
# Ensure now is up-to-date, if desired
if now is None:
now = dt.datetime.utcnow()
now = dt.datetime.now(tz=dt.timezone.utc)

# Define the file information for each data type and check the
# date range
Expand Down
Loading

0 comments on commit 9976fa8

Please sign in to comment.