Skip to content

Commit 3395804

Browse files
authored
Merge pull request #395 from simpeg/test_mth5_split
Update imports for splitting mth5 to other modules
2 parents 05ed408 + 82b91f6 commit 3395804

10 files changed

Lines changed: 108 additions & 118 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Bump version and changelog
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
id-token: write
12+
pull-requests: write
13+
14+
jobs:
15+
bump-version-and-changelog:
16+
if: |
17+
contains(github.event.pull_request.labels.*.name, 'release:major') ||
18+
contains(github.event.pull_request.labels.*.name, 'release:minor') ||
19+
contains(github.event.pull_request.labels.*.name, 'release:patch')
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check out PR branch
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.head_ref }}
26+
fetch-depth: 0
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.13"
33+
34+
- name: Install tools
35+
run: |
36+
pip install bump-my-version build pandoc
37+
sudo apt-get update
38+
sudo apt-get install -y pandoc
39+
cargo install git-cliff
40+
41+
- name: Set up Git user
42+
run: |
43+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
44+
git config --local user.name "github-actions[bot]"
45+
46+
- name: Determine version bump type
47+
id: bump
48+
run: |
49+
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'release:major') }}" == "true" ]]; then
50+
echo "type=major" >> $GITHUB_OUTPUT
51+
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'release:minor') }}" == "true" ]]; then
52+
echo "type=minor" >> $GITHUB_OUTPUT
53+
else
54+
echo "type=patch" >> $GITHUB_OUTPUT
55+
fi
56+
57+
- name: Bump version
58+
run: bump-my-version bump ${{ steps.bump.outputs.type }}
59+
env:
60+
BMV_ALLOW_DIRTY: "true"
61+
62+
- name: Extract version
63+
id: version
64+
run: |
65+
VERSION=$(bump-my-version show current)
66+
echo "Extracted version: $VERSION"
67+
echo "version=$VERSION" >> $GITHUB_OUTPUT
68+
69+
- name: Generate changelog
70+
run: |
71+
git cliff -o CHANGELOG.md
72+
echo "Generated changelog for version ${{ steps.version.outputs.version }}"
73+
74+
- name: Commit and push changes to PR branch
75+
run: |
76+
git add .
77+
git commit -m "chore: bump version to ${{ steps.version.outputs.version }} and update changelog [skip ci]" || echo "No changes to commit"
78+
git push origin HEAD:${{ github.head_ref }}

.github/workflows/publish.yaml

Lines changed: 4 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,19 @@
1-
name: Publish on PR merge
1+
name: Publish release
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened, labeled, closed]
5+
types: [closed]
66
branches:
77
- main
88

99
permissions:
1010
contents: write
1111
id-token: write
12-
pull-requests: write
1312

1413
jobs:
15-
update-version-and-changelog:
16-
# Run only when a release label is added (not on every push)
17-
if: |
18-
github.event.action == 'labeled' &&
19-
github.event.pull_request.merged == false && (
20-
contains(github.event.pull_request.labels.*.name, 'release:major') ||
21-
contains(github.event.pull_request.labels.*.name, 'release:minor') ||
22-
contains(github.event.pull_request.labels.*.name, 'release:patch')
23-
)
14+
publish:
15+
if: github.event.pull_request.merged == true
2416
runs-on: ubuntu-latest
25-
26-
steps:
27-
- name: Check out PR branch
28-
uses: actions/checkout@v4
29-
with:
30-
ref: ${{ github.head_ref }}
31-
fetch-depth: 0
32-
token: ${{ secrets.GITHUB_TOKEN }}
33-
34-
- name: Set up Python
35-
uses: actions/setup-python@v5
36-
with:
37-
python-version: "3.13"
38-
39-
- name: Install tools
40-
run: |
41-
pip install bump-my-version build pandoc
42-
sudo apt-get update
43-
sudo apt-get install -y pandoc
44-
cargo install git-cliff
45-
46-
- name: Set up Git user
47-
run: |
48-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
49-
git config --local user.name "github-actions[bot]"
50-
51-
- name: Determine version bump type
52-
id: bump
53-
run: |
54-
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'release:major') }}" == "true" ]]; then
55-
echo "type=major" >> $GITHUB_OUTPUT
56-
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'release:minor') }}" == "true" ]]; then
57-
echo "type=minor" >> $GITHUB_OUTPUT
58-
else
59-
echo "type=patch" >> $GITHUB_OUTPUT
60-
fi
61-
62-
- name: Bump version
63-
run: bump-my-version bump ${{ steps.bump.outputs.type }}
64-
env:
65-
BMV_ALLOW_DIRTY: "true"
66-
67-
- name: Extract version
68-
id: version
69-
run: |
70-
VERSION=$(bump-my-version show current)
71-
echo "Extracted version: $VERSION"
72-
echo "version=$VERSION" >> $GITHUB_OUTPUT
73-
74-
- name: Generate changelog
75-
run: |
76-
git cliff -o CHANGELOG.md
77-
echo "Generated changelog for version ${{ steps.version.outputs.version }}"
78-
79-
80-
- name: Commit and push changes to PR branch
81-
run: |
82-
git add .
83-
git commit -m "chore: bump version to ${{ steps.version.outputs.version }} and update changelog [skip ci]" || echo "No changes to commit"
84-
git push origin HEAD:${{ github.head_ref }}
85-
86-
publish-after-merge:
87-
# Run only after PR is merged with release labels
88-
if: |
89-
github.event.pull_request.merged == true && (
90-
contains(github.event.pull_request.labels.*.name, 'release:major') ||
91-
contains(github.event.pull_request.labels.*.name, 'release:minor') ||
92-
contains(github.event.pull_request.labels.*.name, 'release:patch')
93-
)
94-
runs-on: ubuntu-latest
95-
9617
steps:
9718
- name: Check out repository
9819
uses: actions/checkout@v4

.github/workflows/test_notebooks.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ jobs:
5757
uv pip install --upgrade pip
5858
uv pip install 'setuptools<68'
5959
uv pip install -e ".[dev,test]"
60-
uv pip install mt_metadata[obspy]
61-
uv pip install "mt_metadata[obspy]"
62-
uv pip install mth5
6360
uv pip install git+https://github.com/kujaku11/mth5_test_data.git
6461
# Explicitly include nbconvert & ipykernel
6562
uv pip install jupyter nbconvert nbformat ipykernel

.github/workflows/tests.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,6 @@ jobs:
4848
uv pip install --upgrade pip
4949
uv pip install 'setuptools<68'
5050
uv pip install -e ".[dev,test]"
51-
uv pip install mt_metadata[obspy]
52-
# uv pip install "mt_metadata[obspy] @ git+https://github.com/kujaku11/mt_metadata.git@patches"
53-
# uv pip install git+https://github.com/kujaku11/mth5.git@patches
54-
# uv pip install "mt_metadata[obspy] @ git+https://github.com/kujaku11/mt_metadata.git"
55-
# uv pip install git+https://github.com/kujaku11/mth5.git
56-
uv pip install "mt_metadata[obspy]"
57-
uv pip install mth5
58-
59-
60-
# uv pip install mth5
6151
uv pip install git+https://github.com/kujaku11/mth5_test_data.git
6252
# Explicitly include nbconvert & ipykernel
6353
uv pip install jupyter nbconvert nbformat ipykernel pytest pytest-cov pytest-timeout codecov

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## Miscellaneous Tasks
6+
7+
- Bump version to and update changelog [skip ci] ([c1576f6](c1576f6e249323b81f3a00dc19f48b25de820a07))
8+
9+
510
## Bug Fixes
611

712
- Fix filter additons to use new add_filter method ([56ab23a](56ab23a18023e01be92e5af5126351236c7dcdd2))

aurora/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.6.1"
1+
__version__ = "0.6.2"
22

33
import sys
44
from loguru import logger

aurora/time_series/frequency_band_helpers.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
This module contains functions that are associated with time series of Fourier coefficients
33
TODO: Move these methods to mth5.processing.spectre.frequency_band_helpers
44
"""
5-
from loguru import logger
6-
from mt_metadata.processing.aurora import (
7-
DecimationLevel as AuroraDecimationLevel,
8-
)
9-
from mt_metadata.processing.aurora import Band
10-
from mth5.timeseries.spectre.spectrogram import extract_band
115
from typing import Optional, Tuple
6+
127
import xarray as xr
8+
from loguru import logger
9+
from mt_metadata.processing.aurora import Band
10+
from mt_metadata.processing.aurora import DecimationLevel as AuroraDecimationLevel
11+
from mt_timeseries.spectre.spectrogram import extract_band
1312

1413

1514
def get_band_for_tf_estimate(

docs/examples/operate_aurora.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,7 +2968,7 @@
29682968
},
29692969
{
29702970
"cell_type": "code",
2971-
"execution_count": 35,
2971+
"execution_count": null,
29722972
"metadata": {},
29732973
"outputs": [
29742974
{
@@ -2983,12 +2983,12 @@
29832983
}
29842984
],
29852985
"source": [
2986-
"tf_cls.write(fn=\"emtfxml_test.xml\", file_type=\"emtfxml\")"
2986+
"tf_cls.write(\"emtfxml_test.xml\", file_type=\"emtfxml\")"
29872987
]
29882988
},
29892989
{
29902990
"cell_type": "code",
2991-
"execution_count": 36,
2991+
"execution_count": null,
29922992
"metadata": {},
29932993
"outputs": [
29942994
{
@@ -3016,12 +3016,12 @@
30163016
}
30173017
],
30183018
"source": [
3019-
"tf_cls.write(fn=\"emtfxml_test.edi\", file_type=\"edi\")"
3019+
"tf_cls.write(\"emtfxml_test.edi\", file_type=\"edi\")"
30203020
]
30213021
},
30223022
{
30233023
"cell_type": "code",
3024-
"execution_count": 37,
3024+
"execution_count": null,
30253025
"metadata": {},
30263026
"outputs": [
30273027
{
@@ -3036,7 +3036,7 @@
30363036
}
30373037
],
30383038
"source": [
3039-
"tf_cls.write(fn=\"emtfxml_test.zss\", file_type=\"zmm\")"
3039+
"tf_cls.write(\"emtfxml_test.zss\", file_type=\"zmm\")"
30403040
]
30413041
},
30423042
{

docs/tutorials/process_cas04_multiple_station.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,7 +3033,7 @@
30333033
},
30343034
{
30353035
"cell_type": "code",
3036-
"execution_count": 19,
3036+
"execution_count": null,
30373037
"id": "2ee6e117-c7e1-40ba-9981-5f2a189e404a",
30383038
"metadata": {},
30393039
"outputs": [
@@ -3049,9 +3049,9 @@
30493049
}
30503050
],
30513051
"source": [
3052-
"tf_cls.write(fn=f\"{tf_file_base}.xml\", file_type=\"emtfxml\")\n",
3053-
"tf_cls.write(fn=f\"{tf_file_base}.edi\", file_type=\"edi\")\n",
3054-
"tf_cls.write(fn=f\"{tf_file_base}.zrr\", file_type=\"zrr\")"
3052+
"tf_cls.write(f\"{tf_file_base}.xml\", file_type=\"emtfxml\")\n",
3053+
"tf_cls.write(f\"{tf_file_base}.edi\", file_type=\"edi\")\n",
3054+
"tf_cls.write(f\"{tf_file_base}.zrr\", file_type=\"zrr\")"
30553055
]
30563056
},
30573057
{
@@ -7048,7 +7048,7 @@
70487048
},
70497049
{
70507050
"cell_type": "code",
7051-
"execution_count": 45,
7051+
"execution_count": null,
70527052
"id": "358195b0",
70537053
"metadata": {},
70547054
"outputs": [
@@ -7077,7 +7077,7 @@
70777077
}
70787078
],
70797079
"source": [
7080-
"tf.write(fn=\"CAS04_rrNVR08.edi\", file_type=\"edi\")"
7080+
"tf.write(\"CAS04_rrNVR08.edi\", file_type=\"edi\")"
70817081
]
70827082
}
70837083
],

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "aurora"
8-
version = "0.6.1"
8+
version = "0.6.2"
99
description = "Processing Codes for Magnetotelluric Data"
1010
readme = "README.rst"
1111
requires-python = ">=3.10"
@@ -25,7 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.12",
2626
]
2727
dependencies = [
28-
"mth5>=0.6.0",
28+
"mth5>=0.6.7",
2929
"numba>=0.58",
3030
"obspy",
3131
"psutil",
@@ -76,7 +76,7 @@ dev = [
7676
]
7777

7878
[tool.bumpversion]
79-
current_version = "0.6.1"
79+
current_version = "0.6.2"
8080
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
8181
serialize = ["{major}.{minor}.{patch}"]
8282
commit = true

0 commit comments

Comments
 (0)