Skip to content

Commit eb5807e

Browse files
committed
Fix GitHub Actions - update to latest versions
1 parent 27cf147 commit eb5807e

59 files changed

Lines changed: 3039 additions & 34 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

6 KB
Binary file not shown.

.github/workflows/deploy.yml

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GitHub Actions workflow for MkDocs deployment
1+
# Simplified GitHub Actions workflow for MkDocs deployment
22
name: Deploy MkDocs Documentation
33

44
on:
@@ -18,20 +18,21 @@ concurrency:
1818
cancel-in-progress: false
1919

2020
jobs:
21-
build:
21+
deploy:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v4
24+
- name: Checkout
25+
uses: actions/checkout@v4
2526
with:
2627
fetch-depth: 0
2728

2829
- name: Setup Python
29-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@v5
3031
with:
3132
python-version: '3.11'
3233

3334
- name: Cache pip dependencies
34-
uses: actions/cache@v3
35+
uses: actions/cache@v4
3536
with:
3637
path: ~/.cache/pip
3738
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -41,32 +42,17 @@ jobs:
4142
- name: Install dependencies
4243
run: |
4344
pip install --upgrade pip
44-
pip install mkdocs mkdocs-material mkdocstrings[python]
45-
pip install mkdocs-git-revision-date-localized-plugin
46-
pip install mkdocs-awesome-pages-plugin
47-
# Install MagGeo package for API documentation
48-
pip install maggeo>=0.2.0
49-
50-
- name: Setup Pages
51-
uses: actions/configure-pages@v3
52-
53-
- name: Build documentation
45+
pip install -r requirements.txt
46+
47+
- name: Copy source code for API docs
5448
run: |
55-
mkdocs build --clean --strict
49+
cp -r maggeo/ ./
50+
51+
- name: Configure Git for mkdocs-git-revision-date
52+
run: |
53+
git config --global user.name 'github-actions[bot]'
54+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
5655
57-
- name: Upload artifact
58-
uses: actions/upload-pages-artifact@v2
59-
with:
60-
path: ./site
61-
62-
deploy:
63-
environment:
64-
name: github-pages
65-
url: ${{ steps.deployment.outputs.page_url }}
66-
runs-on: ubuntu-latest
67-
needs: build
68-
if: github.ref == 'refs/heads/main'
69-
steps:
70-
- name: Deploy to GitHub Pages
71-
id: deployment
72-
uses: actions/deploy-pages@v2
56+
- name: Build and deploy documentation
57+
run: |
58+
mkdocs gh-deploy --force --clean --verbose

__init__.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# maggeo/__init__.py
2+
"""
3+
MagGeo: Data fusion library for annotating GPS trajectories with geomagnetic satellite data from Swarm mission from ESA.
4+
Authors: Fernando Benitez-Paez, Urška Demšar, Jed Long, Ciaran Beggan
5+
6+
This package materialise a data fusion method to annotate GPS trajectories with geomagnetic data from the Swarm satellite mission.
7+
It includes functions for data retrieval, processing, and annotation, as well as debugging utilities.
8+
For more information, please refer to the paper:
9+
10+
Benitez-Paez, F., Brum-Bastos, V.d., Beggan, C.D. et al.
11+
Fusion of wildlife tracking and satellite geomagnetic data for the study of animal migration.
12+
Mov Ecol 9, 31 (2021). https://doi.org/10.1186/s40462-021-00268-4
13+
14+
"""
15+
16+
__version__ = "0.2.0"
17+
__author__ = "Fernando Benitez-Paez, Urška Demšar, Jed Long, Ciaran Beggan"
18+
__email__ = "Fernando.Benitez@st-andrews.ac.uk"
19+
20+
# Lazy imports to avoid immediate dependency loading
21+
def get_main_function():
22+
"""Get the main annotation function with lazy import."""
23+
try:
24+
from .core import annotate_gps_with_geomag
25+
return annotate_gps_with_geomag
26+
except ImportError as e:
27+
raise ImportError(f"Could not import core functionality. Please ensure all dependencies are installed: {e}")
28+
29+
# Only expose main function, date utilities, indices, parallel functions, and swarm data manager to avoid import issues
30+
__all__ = ['annotate_gps_with_geomag', 'identify_unique_dates', 'get_ae_index', 'get_sme_index', 'merge_indices_with_maggeo',
31+
'SwarmDataManager', 'download_swarm_data_for_trajectory', 'load_swarm_data',
32+
'parallel_row_handler', 'parallel_st_idw_process', 'parallel_chaos_ground_values', '__version__']
33+
34+
# Make main function, date utilities, indices, parallel functions, and swarm data manager available
35+
try:
36+
from .core import annotate_gps_with_geomag
37+
from .date_utils import identify_unique_dates
38+
from .parallel_processing import parallel_row_handler
39+
from .interpolation import parallel_st_idw_process
40+
from .chaos import parallel_chaos_ground_values
41+
from .indices import get_ae_index, get_sme_index, merge_indices_with_maggeo
42+
from .swarm_data_manager import SwarmDataManager, download_swarm_data_for_trajectory, load_swarm_data
43+
except ImportError:
44+
# Provide informative error message
45+
def annotate_gps_with_geomag(*args, **kwargs):
46+
raise ImportError(
47+
"MagGeo core functionality is not available. "
48+
"Please ensure all dependencies are installed:\n"
49+
"pip install viresclient chaosmagpy pandas netCDF jupyterlab \n"
50+
"or install MagGeo with conda using the provided environment.yml"
51+
)
52+
53+
def identify_unique_dates(*args, **kwargs):
54+
raise ImportError(
55+
"MagGeo core functionality is not available. "
56+
"Please ensure all dependencies are installed:\n"
57+
"pip install viresclient chaosmagpy pandas netCDF jupyterlab hapiclient \n"
58+
"or install MagGeo with conda using the provided environment.yml"
59+
)
60+
61+
def get_ae_index(*args, **kwargs):
62+
raise ImportError(
63+
"MagGeo indices functionality is not available. "
64+
"Please ensure all dependencies are installed:\n"
65+
"pip install hapiclient pandas numpy \n"
66+
"or install MagGeo with conda using the provided environment.yml"
67+
)
68+
69+
def get_sme_index(*args, **kwargs):
70+
raise ImportError(
71+
"MagGeo indices functionality is not available. "
72+
"Please ensure all dependencies are installed:\n"
73+
"pip install hapiclient pandas numpy \n"
74+
"or install MagGeo with conda using the provided environment.yml"
75+
)
76+
77+
def merge_indices_with_maggeo(*args, **kwargs):
78+
raise ImportError(
79+
"MagGeo indices functionality is not available. "
80+
"Please ensure all dependencies are installed:\n"
81+
"pip install hapiclient pandas numpy \n"
82+
"or install MagGeo with conda using the provided environment.yml"
83+
)
3.65 KB
Binary file not shown.
3.15 KB
Binary file not shown.
1.48 KB
Binary file not shown.
1.59 KB
Binary file not shown.
6.59 KB
Binary file not shown.
4.87 KB
Binary file not shown.
4.87 KB
Binary file not shown.

0 commit comments

Comments
 (0)