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

MAINT: Bugs and updates #131

Merged
merged 74 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
c5f1815
MAINT: added .DS_Store to gitignore
aburrell Mar 25, 2024
107d305
MAINT: updated dep warnings
aburrell Mar 25, 2024
9e6b437
MAINT: updated pyproject.toml
aburrell Mar 25, 2024
df5da60
ENH: updated pyproject.toml
aburrell Mar 25, 2024
c4b4700
TST: added test for release candidate
aburrell Mar 25, 2024
2f6fb7a
TST: updated CI tests
aburrell Mar 25, 2024
0dbc5aa
MAINT: update version number access
aburrell Mar 25, 2024
5fe8855
STY: update boundary directory
aburrell Mar 25, 2024
fba385a
ENH: update SuperMAG file reading
aburrell Mar 25, 2024
987301e
DOC: added missing docstring
aburrell Mar 25, 2024
9881f45
TST: created a common class for tests
aburrell Mar 25, 2024
106e920
TST: simplified vorticity tests
aburrell Mar 25, 2024
54e0e78
TST: simplified SuperMAG tests
aburrell Mar 25, 2024
30dfeee
MAINT: addressed deprecation warning
aburrell Mar 26, 2024
6733f8a
STY: reduced duplicate code in pysat_instruments
aburrell Mar 26, 2024
59efe3d
TST: updated pysat unit tests
aburrell Mar 26, 2024
b7c39d2
DOC: updated docstrings for time tests
aburrell Mar 26, 2024
35e5b51
STY: updated scaling tests
aburrell Mar 26, 2024
e4989ec
BUG: fixed bug in shape tests
aburrell Mar 27, 2024
f5c9910
BUG: fixed bugs in test updates
aburrell Mar 27, 2024
7d22e8b
TST: updated general tests
aburrell Mar 27, 2024
767cf0c
BUG: fixed error check
aburrell Mar 27, 2024
a943868
STY: updated files tests
aburrell Mar 27, 2024
08bd5dd
STY: use unittest method
aburrell Mar 27, 2024
8a4a778
STY: update dmsp_ssj to use common test elements
aburrell Mar 27, 2024
14e4e67
BUG: fixed file cleanup
aburrell Mar 27, 2024
30dedee
STY: removed unused import
aburrell Mar 27, 2024
0b2acf1
ENH: improved fetch robustness
aburrell Mar 27, 2024
a1c4513
STY: use common test elements in cycle tests
aburrell Mar 27, 2024
a8020e0
STY: use common class in boundary tests
aburrell Mar 27, 2024
0346494
BUG: fixed bugs in unit tests
aburrell Mar 27, 2024
ebe986e
DOC: fixed typo in example
aburrell Mar 28, 2024
cbbac41
DOC: updated changelog
aburrell Mar 28, 2024
0e3d078
TST: added a readthedocs yaml
aburrell Mar 28, 2024
651dfa9
STY: added return to all methods
aburrell Mar 28, 2024
c22ebfe
STY: added an end line
aburrell Mar 28, 2024
f890a5b
BUG: fixed toml format
aburrell Mar 28, 2024
78d77d2
STY: added missing blank line
aburrell Mar 28, 2024
fc34717
BUG: update coverage install
aburrell Mar 28, 2024
24ff591
DOC: update redirecting links
aburrell Mar 28, 2024
4d6de17
DOC: updated email
aburrell Mar 28, 2024
9fd31d9
STY: Update CODE_OF_CONDUCT.md
aburrell Mar 28, 2024
00d291d
DOC: updated index depth
aburrell Mar 28, 2024
e58496b
Merge branch 'bug_and_updates' of https://github.com/aburrell/ocbpy i…
aburrell Mar 28, 2024
6537dcb
BUG: update coveralls
aburrell Mar 28, 2024
f042669
BUG: Update .github/workflows/main.yml
aburrell Mar 29, 2024
0d6d379
BUG: use true pipe
aburrell Mar 29, 2024
bca7423
BUG: try coverallsapp
aburrell Mar 29, 2024
fe537ce
Revert "BUG: try coverallsapp"
aburrell Mar 29, 2024
4d66d69
BUG: try using coveralls reporter
aburrell Mar 29, 2024
31607f3
BUG: add requests to test requirements
aburrell Mar 29, 2024
6c8d451
BUG: fix yaml if statements
aburrell Mar 29, 2024
aa26555
BUG: fix yaml error
aburrell Mar 29, 2024
dde77c6
TST: created a coveralls.yaml
aburrell Mar 29, 2024
afa3d25
BUG: fixed security leak
aburrell Mar 29, 2024
40e2735
BUG: fixed token bug
aburrell Mar 29, 2024
7c09391
BUG: fix windows command
aburrell Mar 29, 2024
ef57429
BUG: removed tab from yaml
aburrell Mar 29, 2024
5c6505a
BUG: try tar on windows
aburrell Mar 29, 2024
db56e8c
BUG: use README snippet
aburrell Mar 29, 2024
a64cbda
BUG: update for parallel builds
aburrell Apr 1, 2024
03d481b
BUG: remove unnecessary download
aburrell Apr 2, 2024
d9f7aae
BUG: improve coveralls call
aburrell Apr 2, 2024
7d39757
BUG: reverted download/call order
aburrell Apr 2, 2024
f5c5515
BUG: removed old code block
aburrell Apr 3, 2024
5706bf6
BUG: fixed final coveralls call
aburrell Apr 3, 2024
e25bd5d
BUG: finish requires coveralls download
aburrell Apr 3, 2024
ee036aa
MAINT: updated .gitignore
aburrell Apr 4, 2024
96474f4
BUG: use coverage xml
aburrell Apr 4, 2024
7c0faf3
DOC: udpated changelog
aburrell Apr 4, 2024
486796d
BUG: removed tabs
aburrell Apr 4, 2024
de87059
BUG: fixed coveralls file specification
aburrell Apr 4, 2024
f386399
BUG: added run number
aburrell Apr 4, 2024
294ddd6
BUG: try more build-number specificiations
aburrell Apr 4, 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
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
29 changes: 10 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
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]
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
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,23 @@ 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

- name: Publish results to coveralls upon success
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_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: coveralls --rcfile=pyproject.toml --service=github || true
aburrell marked this conversation as resolved.
Show resolved Hide resolved

finish:
name: Finish Coverage Analysis
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
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 }}
run: |
pip install --upgrade coveralls
coveralls --service=github --finish || true
coveralls --service=github --finish
aburrell marked this conversation as resolved.
Show resolved Hide resolved
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__)"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Autosaves
*~
.DS_Store

# Compiled python modules.
*.py[cod]
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/
14 changes: 12 additions & 2 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@ 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
* 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
9 changes: 7 additions & 2 deletions ocbpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
# ----------------------------------------------------------------------------
"""Auroral oval and polar cap normalised location calculation tools."""

# Define a logger object to allow easier log handling
import logging

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata

# Define a logger object to allow easier log handling
logging.raiseExceptions = False
logger = logging.getLogger('ocbpy_logger')

Expand All @@ -27,4 +32,4 @@
from ocbpy.cycle_boundary import match_data_ocb # noqa F401

# Define the global variables
__version__ = str('0.3.0')
__version__ = metadata.version('ocbpy')
Loading
Loading