Skip to content

Commit

Permalink
Merge pull request #131 from aburrell/bug_and_updates
Browse files Browse the repository at this point in the history
MAINT: Bugs and updates
  • Loading branch information
aburrell authored Apr 5, 2024
2 parents 1046849 + 294ddd6 commit 24f1bd9
Show file tree
Hide file tree
Showing 33 changed files with 1,240 additions and 1,629 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@ on: [push, pull_request]
jobs:
build:

runs-on: ubuntu-latest
runs-on: ["ubuntu-latest"]
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
python-version: ["3.11"]

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

- name: Set CDF Lib environment variable
run: echo "CDF_LIB=$HOME/lib" >> $GITHUB_ENV

- name: Install standard and test dependencies, then ocbpy
- name: Install dependencies
run: |
pip install -r docs/requirements.txt sphinx sphinx_rtd_theme numpydoc
pip install .[doc]
bash requirements.extra 2
python setup.py install
- name: Check documentation build
run: sphinx-build -E -b html docs dist/docs
Expand Down
70 changes: 43 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
install-extras: [0, 1, 2]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
install-extras: [0, 1, 2] # TODO(#129): update to replace extra flag
exclude:
- os: windows-latest
- os: "windows-latest"
install-extras: 2

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

Expand All @@ -37,16 +37,14 @@ jobs:
env:
CDF_LIB: $HOME/lib
run: |
pip install -r requirements.txt
pip install .[test]
bash requirements.extra ${{ matrix.install-extras }}
python setup.py install
- name: Install standard and test dependencies, then ocbpy without SSJ
if: ${{ matrix.install-extras != 2 }}
run: |
pip install -r requirements.txt
pip install .[test]
bash requirements.extra ${{ matrix.install-extras }}
python setup.py install
- name: Test PEP8 compliance
run: flake8 . --count --show-source --statistics
Expand All @@ -55,30 +53,48 @@ jobs:
run: flake8 . --count --exit-zero --max-complexity=10 --statistics

- name: Run unit and integration tests
run: coverage run --rcfile=setup.cfg -m unittest discover
run: |
coverage run --rcfile=pyproject.toml -m unittest discover
coverage report
coverage xml --rcfile=pyproject.toml
- name: Install and run Coveralls Reporter(Linux)
if: startsWith(matrix.os, 'ubuntu')
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_PARALLEL: true
run: |
curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz
./coveralls report -f coverage.xml --parallel --repo-token=${{ secrets.COVERALLS_REPO_TOKEN }} --build-number ${{ github.run_number }}
- name: Install and run Coveralls Reporter (Windows)
if: startsWith(matrix.os, 'windows')
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_PARALLEL: true
run: |
curl -L https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.exe -o coveralls.exe
./coveralls.exe report -f coverage.xml --parallel --repo-token=${{ secrets.COVERALLS_REPO_TOKEN }} --build-number ${{ github.run_number }}
- name: Publish results to coveralls upon success
- name: Report and run Coveralls (macOS)
if: startsWith(matrix.os, 'macos')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.install-extras }}
run: coveralls --rcfile=setup.cfg --service=github || true
run: |
brew tap coverallsapp/coveralls --quiet
brew install coveralls --quiet
coveralls report -f coverage.xml --parallel --repo-token=${{ secrets.COVERALLS_REPO_TOKEN }} --build-number ${{ github.run_number }}
finish:
name: Finish Coverage Analysis
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_PARALLEL: true
run: |
pip install --upgrade coveralls
coveralls --service=github --finish || true
curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz
./coveralls done --build-number ${{ github.run_number }}
36 changes: 36 additions & 0 deletions .github/workflows/pip_rc_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies and the latest RC of ocbpy from
# Test PyPi. This test should be manually run before a Release Candidate is
# officially approved and versioned. For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test install of latest RC from pip

on: [workflow_dispatch]

jobs:
build:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.11"] # Keep this version at the highest supported Python version

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

- name: Install standard dependencies
run: pip install -r requirements.txt

- name: Install pysat RC
run: pip install --no-deps --pre -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ ocbpy

- name: Check that installation imports correctly
run: |
cd ..
python -c "import ocbpy; print(ocbpy.__version__)"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Autosaves
*~
.DS_Store

# Compiled python modules.
*.py[cod]

# Test directories
# Test directories and files
/build/
.tox
.coverage
coverage.xml

# Setuptools distribution folder.
/dist/
Expand Down
24 changes: 24 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Declare the Python requirements required to build your docs
# This method includes a local build of the package
python:
install:
- method: pip
path: .
extra_requirements:
- doc
56 changes: 43 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual
identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
Expand All @@ -16,31 +22,55 @@ Examples of behavior that contributes to creating a positive environment include

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions that
are not aligned to this Code of Conduct, or to ban temporarily or permanently
any contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may
be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected].
The project team will review and investigate all complaints, and will respond in
a way that it deems appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
[https://www.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/
10 changes: 5 additions & 5 deletions CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Enforcement
-----------

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at angeline.burrell@nrl.navy.mil. The
project team will review and investigate all complaints, and will respond in a
way that it deems appropriate to the circumstances. The project team is
reported by contacting the project team at angeline.g.burrell.civ@us.navy.mil.
The project team will review and investigate all complaints, and will respond in
a way that it deems appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.
Expand All @@ -78,5 +78,5 @@ Attribution
This Code of Conduct is adapted from the Contributor Covenant [homepage]_,
version [1.4]_.

.. [homepage] https://contributor-covenant.org
.. [1.4] https://contributor-covenant.org/version/1/4/
.. [homepage] https://www.contributor-covenant.org/
.. [1.4] https://www.contributor-covenant.org/version/1/4/
15 changes: 13 additions & 2 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@ Changelog

Summary of all changes made since the first stable release

0.X.X (XX-XX-2023)
0.4.0 (XX-XX-2024)
------------------
* DEP: Deprecated functions that depend on ssj_auroral_boundary_package
* DEP: Removed classes and kwargs deprecated in v0.3.0
* MAINT: Added a pyproject.toml file
* MAINT: Added a pyproject.toml file and removed setup.py
* MAINT: Updated numpy logic to address DeprecationWarnings
* MAINT: Updated GitHub Action yamls to use pyproject.toml and cycle versions
* MAINT: Updated GitHub Action yamls to use coveralls-reporter
* ENH: Added AMPERE OCBs up to 2022, using updated AMPERE data
* ENH: Added AMPERE EABs, using the Heppner-Maynard boundary as a valid EAB
* ENH: Changed default directory ID to use `pathlib`
* ENH: Allow data padding in `pysat_instrument` functions
* BUG: Fixed a typo in the documentation's pysat example
* BUG: Added an error catch for badly formatted SuperMAG file reading
* TST: Added a new CI test for the Test PyPi Release Candidate
* TST: Reduced duplication by creating a common test class and test variable
* TST: Added a ReadTheDocs yaml
* DOC: Improved docstring style compliance and correctness

0.3.0 (10-21-2022)
------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/ex_pysat_eab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ using the following commands.

# Replace `user` with a string holding your name and `password` with your
# email. Madrigal uses these to demonstrate their utility to funders.
tec = pysat.Instrumet(inst_module=py_mad.instruments.gnss_tec, tag='vtec',
user=user, password=password)
tec = pysat.Instrument(inst_module=py_mad.instruments.gnss_tec, tag='vtec',
user=user, password=password)
tec.download(start=eab.dtime[eab.rec_ind])
print(tec.files.files)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This documentation describes the Open Closed field line Boundary (OCB) gridding
process and provides examples for usage.

.. toctree::
:maxdepth: -1
:maxdepth: 2

overview.rst
citing.rst
Expand Down
Loading

0 comments on commit 24f1bd9

Please sign in to comment.