Skip to content

Commit

Permalink
Merge pull request #130 from pysat/rc_0_0_4
Browse files Browse the repository at this point in the history
Release Candidate 0.0.4
  • Loading branch information
jklenzing committed Nov 7, 2022
2 parents 9b9b4fd + 3ff8001 commit 7d2b86c
Show file tree
Hide file tree
Showing 44 changed files with 1,484 additions and 700 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:

name: Documentation tests
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,39 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10"]
numpy_ver: [latest]
include:
- python-version: "3.8"
numpy_ver: "1.19"
numpy_ver: "1.20"
os: ubuntu-latest

name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install standard dependencies
run: |
pip install -r requirements.txt
pip install -r test_requirements.txt
- name: Reinstall fortran on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew reinstall gcc

- name: Install NEP29 dependencies
if: ${{ matrix.numpy_ver != 'latest'}}
run: |
pip install --no-binary :numpy: numpy==${{ matrix.numpy_ver }}
# Need to force a version of pandas compliant with NEP29
pip install "pandas<1.5"
- name: Install standard dependencies
run: |
pip install -r requirements.txt
pip install pysatCDF --no-binary=pysatCDF
pip install -r test_requirements.txt
- name: Set up pysat
run: |
Expand All @@ -50,7 +57,7 @@ jobs:

- name: Test with pytest
run: |
pytest --cov=pysatNASA/
pytest -vs --cov=pysatNASA/
- name: Publish results to coveralls
env:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/pysat_rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test with latest pysat RC

on: [workflow_dispatch]

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10"]

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Reinstall fortran on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew reinstall gcc

- name: Install pysat RC
run: pip install --no-deps -i https://test.pypi.org/simple/ pysat

- name: Install standard dependencies
run: |
pip install -r requirements.txt
pip install pysatCDF --no-binary=pysatCDF
pip install -r test_requirements.txt
- name: Set up pysat
run: |
mkdir pysatData
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"
- name: Test with pytest
run: pytest -vs --cov=pysatNASA/

- name: Publish results to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --rcfile=setup.cfg --service=github
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,41 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [0.0.4] - 2022-11-11
* Update instrument tests with new test class
* Support xarray datasets through cdflib
* Preferentially loads data into pandas using pysatCDF if installed
* Adds pysatCDF to optional requirements invoked via '[all]' option at installation
* New Instruments
* JPL GPS ROTI
* Bug Fixes
* Fixed a bug in metadata when loading GOLD Nmax data.
* Fixed a bug in user feedback for `methods.cdaweb.download`
* Fixed a bug in loading ICON IVM data (added multi_file_day = True)
* Allow for array-like OMNI HRO meta data
* Fixed date handling for OMNI HRO downloads
* Updated filenames for TIMED SABER
* Maintenance
* Reduce duplication of code in instrument modules
* Include flake8 linting of docstrings and style in Github Actions
* Move OMNI HRO custom functions to a methods module
* Deprecate OMNI HRO custom functions in instrument module
* Update GitHub actions to the latest versions
* Added downstream test to test code with pysat RC
* Remove deprecated `convert_timestamp_to_datetime` calls
* Remove deprecated pandas syntax
* Added version cap for xarray 2022.11
* Documentation
* New logo added

## [0.0.3] - 2022-05-18
* 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
* Fixed metadata type issues when loading ICON instrument data.
* Maintenance
* Removed dummy vars after importing instruments and constellations
* Updated NEP29 compliance in Github Actions
Expand Down
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
[homepage]: https://www.contributor-covenant.org
[version]: https://www.contributor-covenant.org/version/1/4/
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="left">
<img height="0" width="0px">
<img width="20%" src="https://raw.githubusercontent.com/pysat/pysatNASA/main/docs/figures/pysatnasa_logo.jpg" alt="pysatNASA" title="pysatNASA" </img>
<img width="20%" src="https://raw.githubusercontent.com/pysat/pysatNASA/main/docs/figures/logo.png" alt="pysatNASA" title="pysatNASA" </img>
</div>

# pysatNASA: pysat support for NASA Space Science instruments
Expand All @@ -20,17 +20,17 @@ some examples on how to use the routines

pysatNASA uses common Python modules, as well as modules developed by
and for the Space Physics community. This module officially supports
Python 3.7+.

| Common modules | Community modules |
| -------------- | ----------------- |
| beautifulsoup4 | cdflib |
| lxml | pysat |
| netCDF4 | |
| numpy | |
| pandas | |
| requests | |
| xarray | |
Python 3.8+.

| Common modules | Community modules |
| ---------------- | ----------------- |
| beautifulsoup4 | cdflib |
| lxml | pysat>=3.0.4 |
| netCDF4 | |
| numpy | |
| pandas | |
| requests | |
| xarray<2022.11 | |

## GitHub Installation

Expand All @@ -50,7 +50,7 @@ python setup.py install

Note: pre-1.0.0 version
-----------------------
pysatNASA is currently in an initial development phase and requires pysat 3.0.0.
pysatNASA is currently in an initial development phase and requires pysat 3.0.4.

# Using with pysat

Expand Down
10 changes: 7 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
#
# needs_sphinx = '1.0'

package_root = "."

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
extensions = ['sphinxcontrib.extras_require',
'sphinx-prompt',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
Expand Down Expand Up @@ -68,7 +72,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -92,7 +96,7 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_logo = os.path.join(os.path.abspath('.'), 'figures', 'pysatnasa_logo.jpg')
html_logo = os.path.join(os.path.abspath('.'), 'figures', 'logo.png')
html_theme_options = {'logo_only': True}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
Binary file added docs/figures/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/figures/pysatnasa_logo.jpg
Binary file not shown.
19 changes: 11 additions & 8 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ Prerequisites

pysatNASA uses common Python modules, as well as modules developed by
and for the Space Physics community. This module officially supports
Python 3.7+ and pysat 3.0.0+.
Python 3.8+ and pysat 3.0.4+.

================ =================
Common modules Community modules
================ =================
beautifulsoup4 cdflib>=0.4.4
lxml pysat>=3.0.0
================== =================
Common modules Community modules
================== =================
beautifulsoup4 cdflib>=0.4.4
lxml pysat>=3.0.4
netCDF4
numpy
pandas
requests
xarray
================ =================
xarray<2022.11
================== =================


Installation Options
Expand Down Expand Up @@ -56,6 +56,9 @@ Installation Options

python setup.py develop --user

.. extras-require:: all
:setup.cfg:

.. _post-install:

Post Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a library of ``pysat`` instrument modules and methods designed to suppor
NASA instruments and missions archived at the Community Data Analysis Web
portal.

.. image:: figures/pysatnasa_logo.jpg
.. image:: figures/logo.png
:width: 400px
:align: center
:alt: pysatNASA Logo, a blue planet with red orbiting python and the module name superimposed
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
extras_require
m2r2
numpydoc
pysat
Expand Down
8 changes: 8 additions & 0 deletions docs/supported_instruments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ ISS FPMU
.. automodule:: pysatNASA.instruments.iss_fpmu
:members:

.. _jpl_gps:

JPL GPS
-------

.. automodule:: pysatNASA.instruments.jpl_gps
:members:

.. _omni_hro:

OMNI HRO
Expand Down
14 changes: 13 additions & 1 deletion pysatNASA/constellations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@
package.
"""

import logging

import pysat

__all__ = ['de2', 'icon']

# TODO(#89): reevaluate logger suppression if fixes implemented in pysat
# Save current level and turn off before constellation import
user_level = pysat.logger.level
pysat.logger.setLevel(logging.WARNING)

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

# Restore user level
pysat.logger.setLevel(user_level)

# Remove dummy variable
del const
del const, user_level
2 changes: 1 addition & 1 deletion pysatNASA/instruments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'de2_lang', 'de2_nacs', 'de2_rpa', 'de2_wats',
'formosat1_ivm',
'icon_euv', 'icon_fuv', 'icon_ivm', 'icon_mighti',
'iss_fpmu', 'omni_hro', 'ses14_gold',
'iss_fpmu', 'jpl_gps', 'omni_hro', 'ses14_gold',
'timed_saber', 'timed_see']

for inst in __all__:
Expand Down
16 changes: 3 additions & 13 deletions pysatNASA/instruments/cnofs_ivm.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
import numpy as np

from pysat.instruments.methods import general as mm_gen
from pysat import logger

from pysatNASA.instruments.methods import cdaweb as cdw
from pysatNASA.instruments.methods import cnofs as mm_cnofs
from pysatNASA.instruments.methods import general as mm_nasa

# ----------------------------------------------------------------------------
# Instrument attributes
Expand All @@ -82,18 +82,8 @@
# Instrument methods


def init(self):
"""Initialize the Instrument object with instrument specific values.
Runs once upon instantiation.
"""
logger.info(mm_cnofs.ackn_str)
self.acknowledgements = mm_cnofs.ackn_str
self.references = '\n'.join((mm_cnofs.refs['mission'],
mm_cnofs.refs['ivm']))

return
# Use standard init routine
init = functools.partial(mm_nasa.init, module=mm_cnofs, name=name)


def preprocess(self):
Expand Down

0 comments on commit 7d2b86c

Please sign in to comment.