Skip to content

Commit

Permalink
Merge pull request #147 from aburrell/rcv2.1.0
Browse files Browse the repository at this point in the history
RC v2.1.0
  • Loading branch information
aburrell authored Jan 7, 2025
2 parents fcb71d5 + 47d32d6 commit fb1ae8a
Show file tree
Hide file tree
Showing 32 changed files with 554 additions and 397 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9"]
python-version: ["3.11"]

env:
FC: gfortran
Expand All @@ -31,7 +31,7 @@ jobs:
run: |
pip install build
python -m build .
pip install -r docs/requirements.txt
pip install .[doc]
- name: Check documentation build
run: sphinx-build -E -b html docs dist/docs
Expand Down
31 changes: 25 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,30 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
numpy_ver: ["latest"]
test_config: ["latest"]
include:
# Support different GA Mac environmnets
- python-version: "3.9"
os: "macos-13"
numpy_ver: "latest"
- python-version: "3.10"
os: "macos-13"
numpy_ver: "latest"
- python-version: "3.11"
os: "macos-latest"
numpy_ver: "latest"
- python-version: "3.12"
os: "macos-latest"
numpy_ver: "latest"
# NEP29 compliance settings
- python-version: "3.10"
numpy_ver: "1.25"
os: "ubuntu-latest"
test_config: "NEP29"

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with Numpy ${{ matrix.numpy_ver }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -44,23 +58,28 @@ jobs:
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
gfortran --version
pip install flake8 meson-python pytest pytest-cov pytest-xdist scipy
pip install "numpy>=1.19.5,<2"
pip install "numpy>=1.19.5"
- name: Install NEP29 dependencies
if: ${{ matrix.test_config == 'NEP29'}}
run: |
pip install numpy==${{ matrix.numpy_ver }}
- name: Install on Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pip install .[test]
run: pip install --upgrade-strategy only-if-needed .[test]

- name: Install on MacOS-13
if: ${{ matrix.os == 'macos-13' }}
run: |
brew reinstall gcc@14
CC=/usr/local/bin/gcc-14 pip install .[test]
CC=/usr/local/bin/gcc-14 pip install --upgrade-strategy only-if-needed .[test]
- name: Install on MacOS-Latest
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew reinstall gcc@14
CC=/opt/homebrew/bin/gcc-14 pip install .[test]
CC=/opt/homebrew/bin/gcc-14 pip install --upgrade-strategy only-if-needed .[test]
- name: Install on Windows
if: ${{ matrix.os == 'windows-latest' }}
Expand Down
38 changes: 24 additions & 14 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"license": {
"id": "MIT"
},
},
"notes": "When referencing this package, please cite both the package DOI and the Apex Coordinates journal article: Emmert, J. T., A. D. Richmond, and D. P. Drob (2010), A computationally compact representation of Magnetic-Apex and Quasi-Dipole coordinates with smooth base vectors, J. Geophys. Res., 115(A8), A08322, doi:10.1029/2010JA015326.",
"references": [
"Emmert, J. T., A. D. Richmond, and D. P. Drob (2010), A computationally compact representation of Magnetic-Apex and Quasi-Dipole coordinates with smooth base vectors, J. Geophys. Res., 115(A8), A08322, doi:10.1029/2010JA015326.",
"Richmond, A. D. (1995), Ionospheric Electrodynamics Using Magnetic Apex Coordinates, Journal of geomagnetism and geoelectricity, 47(2), 191–212, doi:10.5636/jgg.47.191."
],
],
"keywords": [
"Magnetic Apex Coordinates",
"Quasi Dipole Coordinates",
"MLT",
"Magnetic Local Time",
"Conversion",
"Coordinate Conversion",
"Converting",
"Ionosphere",
"Magnetic Field",
"Space Physics",
"MLT",
"Magnetic Local Time",
"Conversion",
"Coordinate Conversion",
"Converting",
"Ionosphere",
"Magnetic Field",
"Space Physics",
"Heliophysics"
],
],
"creators": [
{
"orcid": "0000-0002-8043-0953",
"orcid": "0000-0002-8043-0953",
"name": "van der Meeren, Christer"
},
{
"orcid": "0000-0001-5028-4943",
"name": "Laundal, Karl M."
},
{
"orcid": "0000-0001-8875-9326",
"affiliation": "Naval Research Laboratory",
"orcid": "0000-0001-8875-9326",
"affiliation": "Naval Research Laboratory",
"name": "Burrell, Angeline G."
},
{
Expand All @@ -50,6 +50,16 @@
"orcid": "0000-0001-7955-4441",
"affiliation": "GFZ German Research Centre for Geosciences",
"name": "Morschhauser, Achim"
},
{
"orcid": "0000-0001-9741-4063",
"affiliation": "GFZ German Research Centre for Geosciences",
"name": "Michaelis, Ingo"
},
{
"orcid": "0000-0001-8321-6074",
"affiliation": "Goddard Space Flight Center",
"name": "Klenzing, Jeff"
}
]
}
7 changes: 6 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ This python wrapper is made by:
* Gregory Starr
* Ashton Reimer
* Achim Morschhauser
* Ingo Michaelis
* Jeff Klenzing

Fortran code by Emmert et al. [2010] [1]_. Quasi-dipole and modified
apex coordinates are defined by Richmond [1995] [2]_. The code uses
IGRF-12 with coefficients valid through 2020 [Thébault et al., 2015] [3]_.
IGRF-14 with coefficients valid through 2030. A special issue on IGRF-14 is
currently accepting
`submissions <https://www.springeropen.com/collections/IGRF14>`_. A reference
for IGRF-12 is [Thébault et al., 2015] [3]_.

.. [1] Emmert, J. T., A. D. Richmond, and D. P. Drob (2010),
A computationally compact representation of Magnetic-Apex
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
Changelog
=========

2.1.0 (2024-12-31)
------------------
* Adapted codebase to read IRGF coefficients from a file (updated to IGRF-14)
* Updated package to be compliant and installable with numpy 2.0+
* Added tests for Python 3.12 and NEP29
* Fixed link to logo in the README
* Updated pyproject.toml to include most metadata instead of setup.cfg
* Added a citation section to the docs
* Fixed the command-line executable
* Updated code to address deprecation warnings around np.float64 use
* Updated code to remove use of datetime `utcnow`
* Updated meson build requirements to include ninja for Windows builds instead of python-dev-tools

2.0.2 (2024-11-12)
------------------
* Updated supported Python versions (3.9-3.11)
Expand Down
8 changes: 4 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ 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 angeline.burrell@nrl.navy.mil. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
reported by contacting the project team at angeline.g.burrell.civ@us.navy.mil.
All complaints will be reviewed and investigated and will result in a response
that is deemed necessary and 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 Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ graft docs
graft fortranapex
graft .github

recursive-include apexpy *.txt meson.build
recursive-include apexpy *.txt apexsh.dat meson.build

include *.rst
include *.md
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ Badges
.. |doi| image:: https://www.zenodo.org/badge/doi/10.5281/zenodo.4585641.svg
:target: https://doi.org/10.5281/zenodo.1214206

.. |logo| image:: docs/apexpy.png
.. |logo| image:: https://github.com/aburrell/apexpy/blob/main/docs/apexpy.png?raw=true
:alt: ApexPy logo: yellow magnetic field lines surrounding the Earth's surface, which is blue
8 changes: 7 additions & 1 deletion apexpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Conversion functions between geodetic and apex magnetic coordinates."""
from importlib import metadata
from sys import stderr

# Below try..catch required for autodoc to work on readthedocs
Expand All @@ -12,5 +14,9 @@
from apexpy import helpers # noqa F401

# Define the global variables
__version__ = "2.0.1"
try:
__version__ = metadata.version('apexpy')
except metadata.PackageNotFoundError:
# Windows installation is not finding the version automatically
__version__ = "2.1.0"
__all__ = ['Apex', 'fortranapex', 'helpers', 'ApexHeightError']
8 changes: 6 additions & 2 deletions apexpy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ def main():
lats, lons = apex_obj.convert(arg_array[:, 0], arg_array[:, 1], args.source,
args.dest, args.height, datetime=in_time)

# Save the output to a file
np.savetxt(args.file_out, np.column_stack((lats, lons)), fmt='%.8f')
# Save the output to a file. Use the name for non-stdout inputs
if args.file_out.name.lower().find('stdout') >= 0:
fout_name = args.file_out
else:
fout_name = args.file_out.name
np.savetxt(fout_name, np.column_stack((lats, lons)), fmt='%.8f')

return

Expand Down
Loading

0 comments on commit fb1ae8a

Please sign in to comment.