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

Version 0.0.2 Release Candidate #149

Merged
merged 74 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
830dcf9
MAINT: remove unnecessary kwargs
aburrell Dec 1, 2023
5208e4f
DOC: updated changelog
aburrell Dec 1, 2023
7cb8acf
MAINT: updated rtd theme
aburrell Dec 1, 2023
50b0aeb
BUG: remove unnecessary if statement
aburrell Dec 1, 2023
71a7ef7
MAINT: updated coveralls
aburrell Dec 1, 2023
a9099f7
Merge pull request #135 from pysat/pysat_rc3.2.0_fixes
aburrell Dec 5, 2023
f0d3806
Merge branch 'develop' into nrl_pub_release
aburrell Feb 16, 2024
87a3e93
Merge pull request #141 from pysat/nrl_pub_release
aburrell Feb 20, 2024
916dc29
BUG: avoid certificate experation
aburrell Jul 30, 2024
f0995e2
MAINT: updated pandas fill method in f107
aburrell Aug 12, 2024
bd271fe
MAINT: updated pandas in kp_ap
aburrell Aug 12, 2024
d86c91a
STY: added logger output
aburrell Aug 12, 2024
068da4b
MAINT: updated pandas in `sw_f107`
aburrell Aug 12, 2024
4b9c8c8
DOC: updated NCEI name
aburrell Aug 12, 2024
445f7f8
DOC: added links to ignore
aburrell Aug 12, 2024
6d375fe
DOC: update summary of changes
aburrell Aug 12, 2024
d042597
MAINT: updated intersphinx mapping
aburrell Aug 12, 2024
e1b5e25
MAINT: cycled python versions
aburrell Aug 12, 2024
db19329
MAINT: updated main CI test
aburrell Aug 12, 2024
688135f
BUG: fixed syntax
aburrell Aug 12, 2024
756a061
MAINT: cycle python to highest supported version
aburrell Aug 12, 2024
ee310e0
BUG: replaced tab with spaces
aburrell Aug 12, 2024
c6cce4f
BUG: added token to coveralls action
aburrell Aug 13, 2024
f9353d8
BUG: removed typo
aburrell Aug 13, 2024
8963895
BUG: change `ffill` to `asfreq`
aburrell Aug 13, 2024
61c5964
BUG: fill for sub-daily frequencies
aburrell Aug 13, 2024
a06ebba
TST: allow local testing
aburrell Aug 13, 2024
1bf5775
BUG: include coveralls in test install
aburrell Aug 13, 2024
c13247c
MAINT: updated pandas frequency
aburrell Aug 13, 2024
06369e6
MAINT: implement pandas iloc
aburrell Aug 13, 2024
c2f9f32
TST: ensure output is xml
aburrell Aug 13, 2024
2c5a0ec
BUG: fixed typo
aburrell Aug 13, 2024
0be7074
TST: force coveralls to finish
aburrell Aug 13, 2024
5d5eaa0
TST: try carryforward
aburrell Aug 13, 2024
715f315
REV: changes were unnecessary
aburrell Aug 13, 2024
081d8fc
TST: added always tag
aburrell Aug 13, 2024
af6f46c
Merge branch 'kp_verify_bug' of https://github.com/pysat/pysatSpaceWe…
aburrell Aug 13, 2024
217093b
TST: remove carryforward
aburrell Aug 13, 2024
73acafb
TST: update coveralls
aburrell Aug 13, 2024
6786a50
Merge pull request #144 from pysat/kp_verify_bug
aburrell Aug 14, 2024
d18c47d
TST: updated utcnow
aburrell Aug 14, 2024
b8b0cc4
MAINT: updated utcnow in methods
aburrell Aug 14, 2024
ecdf422
MAINT: updated utcnow in Instruments
aburrell Aug 14, 2024
fff9629
DOC: updated changelog
aburrell Aug 14, 2024
cf873ca
BUG: fixed bug in `combine_kp`
aburrell Aug 14, 2024
1307f84
BUG: fix `combine_f107` bug
aburrell Aug 14, 2024
31ddf2d
TST: added unit tests for no files
aburrell Aug 14, 2024
9902b97
DOC: updated changelog
aburrell Aug 14, 2024
af72bb5
Merge pull request #145 from pysat/datetime_update
aburrell Aug 14, 2024
c651bd1
Merge branch 'develop' into combine_data_bugfix
aburrell Aug 14, 2024
98b971f
Merge pull request #146 from pysat/combine_data_bugfix
aburrell Aug 14, 2024
36910f2
DOC: updated docstrings
aburrell Aug 14, 2024
7725299
ENH: added NoRP methods
aburrell Aug 14, 2024
b3cb0de
ENH: added NoRP solar radio flux data
aburrell Aug 14, 2024
81134b9
DOC: updated supported instruments
aburrell Aug 14, 2024
9b8b48b
TST: added unit tests for NoRP data
aburrell Aug 14, 2024
f2adc78
DOC: updated Changelog
aburrell Aug 14, 2024
1fa103d
DEP: removed support for deprecated tag, ''
aburrell Aug 14, 2024
f5e7bf3
TST: removed deprecation warning test
aburrell Aug 14, 2024
7810133
DEP: removed support for kp tag ''
aburrell Aug 14, 2024
05c8ab9
MAINT: cycled pysat version
aburrell Aug 14, 2024
468ff2b
TST: removed support for old pysat versions
aburrell Aug 14, 2024
78dfb7c
MAINT: updated f107 methods
aburrell Aug 14, 2024
31e5956
MAINT: removed support for `meta_labels`
aburrell Aug 14, 2024
c96be79
DOC: updated changelog
aburrell Aug 14, 2024
a483cab
STY: removed unused import
aburrell Aug 14, 2024
f1cd6b1
Merge pull request #148 from pysat/v0.2.0_maint
aburrell Aug 15, 2024
ad3f3b1
Merge pull request #147 from pysat/f30_inst
aburrell Aug 15, 2024
b74338d
REL: update version number
aburrell Aug 15, 2024
6396a76
DOC: update copyright year
aburrell Aug 15, 2024
9b1cedb
DOC: set release day
aburrell Aug 15, 2024
958b5d7
DOC: updated affiliations
aburrell Aug 15, 2024
fb63836
BUG: fixed file date for F10.7 'daily' data
aburrell Aug 27, 2024
040e9c4
STY: fixed PEP8 issue in docstring
aburrell Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading