-
Notifications
You must be signed in to change notification settings - Fork 8
patches #388
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
Merged
patches #388
Changes from all commits
Commits
Show all changes
143 commits
Select commit
Hold shift + click to select a range
65314c4
do not exit executing notebooks if one fails
kkappler 3742687
use uv for pytest
kkappler c13634f
rm incorrect uv prefix
kkappler 531faa1
try better utilizing uv, (test can move away from conda)
kkappler a5c110f
add some doc
kkappler b36862e
Update python versions for tests
kkappler a6e106e
rename yml to yaml
kkappler ec6da92
Merge branch 'uv' into patches
kkappler dd739f0
pydantic -- fix imports
kkappler e27f34b
Update processing_configuration_template.json
kujaku11 4b740c2
stop auto testing until we address all tests locally.
kujaku11 714bcf6
Update spectrogram_helpers.py
kujaku11 1eff691
Update test_issue_139.py
kujaku11 0a14739
Update config_creator.py
kujaku11 d0bbde0
updating precommit
kujaku11 a2c9e6a
Add pytest fixtures and test for TF zrr file roundtrip
kujaku11 67ee871
Create test_transfer_function_kernel_pytest.py
kujaku11 056955d
Add synthetic pytest tests and improve test fixtures
kujaku11 c1473cb
Align num_samples_window in frequency band tests
kujaku11 543e6bf
Refactor synthetic test MTH5 file creation for test isolation
kujaku11 0d12513
Migrate synthetic tests from unittest to pytest
kujaku11 6b51c30
Replace transfer function kernel tests with windowing tests
kujaku11 a43f6dd
Add pytest suite for xarray_helpers module
kujaku11 0c2a8da
Remove time series test files
kujaku11 4d38ac7
Add pytest suite for cross_power transfer function
kujaku11 3e80920
Add regression tests for helper_functions and remove cross_power tests
kujaku11 72e11bd
Add regression tests for RegressionEstimator base class
kujaku11 03627ee
Remove regression test files for transfer function
kujaku11 e5b55fa
Add comprehensive Parkfield pytest suite and fixtures
kujaku11 477998f
Update tests.yaml
kujaku11 cd3f7dc
Refactor feature and channel attribute usage
kujaku11 5cc6d4b
Update tests.yaml
kujaku11 403c0e2
Update dataset example for Windows paths and metadata
kujaku11 4d35d16
skipping notebooks for now
kujaku11 862ec08
Fix config save and update test signatures
kujaku11 56ab23a
fix filter additons to use new add_filter method
kkappler 61bb118
force run_id in metadata
kkappler 1098555
update python version info, add some pytest helpers
kkappler 7cf3ae2
Refactor Parkfield tests and fixtures for clarity and robustness
kujaku11 19eef50
Update test_parkfield_pytest.py
kujaku11 05a6744
Improve plot handling and test comments, update warnings
kujaku11 cd6de3c
Improve matplotlib backend handling and test data setup
kujaku11 d2004fe
Refactor tests to reuse processed transfer functions
kujaku11 f97161b
Set fixture scope to class for kernel dataset tests
kujaku11 a733572
Remove obsolete Parkfield test scripts
kujaku11 e077b6f
Update processing_configuration_template.json
kujaku11 19d505c
Optimize synthetic test suite with class-scoped fixtures
kujaku11 c3af257
Fix station metadata by converting timeseries.Station to dict
kujaku11 ed4d66e
Add ZFile transfer function comparison utilities
kujaku11 1f4c864
updating how survey metadata is filled
kujaku11 fd3e9b4
changed default of None to 1
kujaku11 ffb37fc
Update edf_weights.py
kujaku11 438ba49
fixing bugs with feature weighting
kujaku11 f20b578
Update feature_weights.py
kujaku11 861bf3b
updating logging messages
kujaku11 f324408
Use persistent cache for Parkfield MTH5 test data
kujaku11 90d1bd0
Add vectorized pass_band optimization and analysis docs
kujaku11 784a2d1
Update test_parkfield_pytest.py
kujaku11 e1727f1
Improve survey metadata handling in TransferFunctionKernel
kujaku11 201ebfa
removing sandbox test files.
kujaku11 a79c49d
Add discrete Fourier Coefficients synthetic tests
kujaku11 f739df7
Enhance synthetic FC tests and add error handling
kujaku11 64e4894
Refactor and parametrize Fourier Coefficients tests
kujaku11 bd83c89
Add pytest suite for MATLAB Z-file reader
kujaku11 d79a21e
Update tests.yaml
kujaku11 ab00081
Enable parallel test execution and add test dependencies
kujaku11 ec5bca5
Update transfer_function_kernel.py
kujaku11 319721c
Update transfer_function_kernel.py
kujaku11 8ec2684
add ipykernel to dev dependencies
kkappler 899ee02
labelled input arguments
kkappler 8ceb633
update parkfield paths
kkappler 1b9f35b
mark skip TestParkSingleStation.test_singl_station_comparison_with_emtf
kujaku11 1238fc2
Merge branch 'pydantic' of https://github.com/simpeg/aurora into pyda…
kujaku11 321f488
fix chained assignment warnings
kkappler f66ddf0
fix FutureWarnings
kkappler 937b659
fix future warning again
kkappler d610149
revert parkfield paths to .cache
kkappler dc36fbc
make plot before asserting numerical comparison
kkappler 16f0a01
Update DataFrame access and notebook outputs
kujaku11 a47a925
Update process_cas04_multiple_station.ipynb
kujaku11 9d4c975
Add CAS04 processing tests and analysis docs
kujaku11 988c12b
Add mth5_test_data to test workflow dependencies
kujaku11 4a630a9
Add slow test marker and CAS04 test suite README
kujaku11 ceb6cab
Refactor CAS04 test fixtures for versioned parallelization
kujaku11 555d053
Update process_cas04_multiple_station.ipynb
kujaku11 e5ec1bd
Refactor transfer function comparison and remove legacy plotting
kujaku11 0d58179
Refactor TF comparison tests and move helpers
kujaku11 4a17257
Enhance TF comparison metrics and add detailed tests
kujaku11 f8503f7
Refactor and enable single station comparison test
kujaku11 2a15cbd
Update test_parkfield_pytest.py
kujaku11 6c830f1
Update test_parkfield_pytest.py
kujaku11 8ed6c20
Enhance RR comparison test with numerical assertions
kujaku11 1a5dcd2
Improve test configuration and fixture efficiency
kujaku11 191f7f4
Add slow test marker and timeout configuration
kujaku11 9a180b9
Refactor plotting colors and streamline TF plotting
kujaku11 a0b95c9
Update process_cas04_multiple_station.ipynb
kujaku11 c52df75
Cache MTH5 test files and improve test fixture persistence
kujaku11 5a55908
Remove unused 'path' argument in test fixtures
kujaku11 3b06c04
Refactor MTH5 file fixtures for parallel test safety
kujaku11 7f1cc21
Add file locking to test data creation for concurrency
kujaku11 fe3ded7
Add file lock to parkfield_h5_master fixture for concurrency
kujaku11 386feb1
Refactor test helpers and improve file locking in tests
kujaku11 6f520b7
Set measurement azimuth and update TF read options in tests
kujaku11 7f4dbc0
Ensure MTH5 files are closed before renaming in tests
kujaku11 f5a289d
Change pytest to use auto for parallel tests
kujaku11 9ef623b
Use versioned cache directories for FDSN MTH5 test files
kujaku11 24cbc4a
Revert "Use versioned cache directories for FDSN MTH5 test files"
kujaku11 d5c1806
Revert "Ensure MTH5 files are closed before renaming in tests"
kujaku11 c28a407
Update edf_weights.py
kujaku11 2cfd23f
Merge branch 'pydantic' of https://github.com/simpeg/aurora into pyda…
kujaku11 8c04097
adding kwargs to the call
kujaku11 d5f8d16
sometimes a decimation level fails
kujaku11 fc476a6
uncomment notebooks and test 3.10 only
kkappler 6ed7de4
add copy of edi from IRIS SPUD
kkappler 60a076f
run notebook with local version of SPUD TF comparison
kkappler 94aa747
changing tests yaml to pip install of mt-metadata and mth5
kujaku11 5b49b2f
Disable Jupyter Notebooks execution in tests.yaml
kujaku11 f979c0d
Implement Jupyter Notebook execution with error handling
kujaku11 a0659c4
Run just the notebooks catching failures
kujaku11 2d8545a
Add virtual environment activation to test workflow
kujaku11 dbffa42
Refactor testing workflow in GitHub Actions
kujaku11 189881c
Refactor paths for executed notebooks in tests.yaml
kujaku11 7301800
Update tests.yaml
kujaku11 d7911c3
Update pip install command to include nbformat
kujaku11 8b2a339
Activate virtual environment in tests workflow
kujaku11 1fdefdb
Change Jupyter notebook kernel to python3
kujaku11 4b7f18c
Fix formatting issues in tests.yaml file paths
kujaku11 9bf016a
adding simple logging messages
kujaku11 0ae015a
Merge branch 'pydantic' of https://github.com/simpeg/aurora into pyda…
kujaku11 1300f61
Update operate_aurora.ipynb
kujaku11 6c9f01e
Update operate_aurora.ipynb
kujaku11 cbc89e9
Add step to run tests in GitHub Actions workflow
kujaku11 2cfe23b
Update mth5 dependency version requirement
kujaku11 3099246
remove profile results
kkappler 2d00e92
add 3.11 and 3.12 tests back in
kkappler 8b46018
remove profile
kkappler 7449479
remove duplicate compare function
kkappler c0b26c1
remove duplciate code
kkappler 5e0ada5
install from patches on mth5, mt_metadata
kkappler 2f4fa30
restrict numba version
kkappler 3007798
undo overzealous cleanup of io helper
kkappler ac0f38e
Merge branch 'patches' into pydantic
kkappler f4478af
Revert "Merge branch 'patches' into pydantic"
kkappler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
|
|
||
| name: Testing | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '*' | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| setup-build: | ||
| name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }}) | ||
| runs-on: ${{ matrix.os }} | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: ["ubuntu-latest"] | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v3 | ||
| with: | ||
| version: "latest" | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| run: uv python install ${{ matrix.python-version }} | ||
|
|
||
| - name: Cache MTH5 test files | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/aurora | ||
| key: mth5-test-files-${{ runner.os }}-${{ hashFiles('tests/conftest.py') }} | ||
| restore-keys: | | ||
| mth5-test-files-${{ runner.os }}- | ||
|
|
||
| - name: Create virtual environment and install dependencies | ||
| run: | | ||
| uv venv --python ${{ matrix.python-version }} | ||
| source .venv/bin/activate | ||
| uv pip install --upgrade pip | ||
| uv pip install -e ".[dev,test]" | ||
| # uv pip install mt_metadata[obspy] | ||
| uv pip install "mt_metadata[obspy] @ git+https://github.com/kujaku11/mt_metadata.git@patches" | ||
| uv pip install git+https://github.com/kujaku11/mth5.git@patches | ||
|
|
||
| # uv pip install mth5 | ||
| uv pip install git+https://github.com/kujaku11/mth5_test_data.git | ||
| # Explicitly include nbconvert & ipykernel | ||
| uv pip install jupyter nbconvert nbformat ipykernel pytest pytest-cov pytest-timeout codecov | ||
| python -m ipykernel install --user --name "python3" | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y pandoc | ||
|
|
||
| - name: Set kernel and execute Jupyter Notebooks | ||
| run: | | ||
| source .venv/bin/activate | ||
| python << 'EOF' | ||
| import nbformat | ||
| import subprocess | ||
| import sys | ||
|
|
||
| notebooks = [ | ||
| "docs/examples/dataset_definition.ipynb", | ||
| "docs/examples/operate_aurora.ipynb", | ||
| "docs/tutorials/pkd_units_check.ipynb", | ||
| "docs/tutorials/pole_zero_fitting/lemi_pole_zero_fitting_example.ipynb", | ||
| "docs/tutorials/processing_configuration.ipynb", | ||
| "docs/tutorials/process_cas04_multiple_station.ipynb", | ||
| "docs/tutorials/synthetic_data_processing.ipynb" | ||
| ] | ||
|
|
||
| failures = [] | ||
|
|
||
| for nb_path in notebooks: | ||
| # Update kernel spec | ||
| print(f"Updating kernel in {nb_path}") | ||
| try: | ||
| with open(nb_path, "r", encoding="utf-8") as f: | ||
| nb = nbformat.read(f, as_version=4) | ||
|
|
||
| nb["metadata"]["kernelspec"]["name"] = "python3" | ||
| nb["metadata"]["kernelspec"]["display_name"] = "Python (python3)" | ||
|
|
||
| with open(nb_path, "w", encoding="utf-8") as f: | ||
| nbformat.write(nb, f) | ||
| print(f"✓ Updated kernel in {nb_path}") | ||
| except Exception as e: | ||
| print(f"✗ Failed to update kernel in {nb_path}: {e}") | ||
| failures.append(nb_path) | ||
| continue | ||
|
|
||
| # Execute notebook | ||
| print(f"Executing {nb_path}") | ||
| result = subprocess.run( | ||
| ["jupyter", "nbconvert", "--to", "notebook", "--execute", nb_path], | ||
| capture_output=True, | ||
| text=True | ||
| ) | ||
|
|
||
| if result.returncode != 0: | ||
| print(f"✗ Failed to execute {nb_path}") | ||
| print(result.stderr) | ||
| failures.append(nb_path) | ||
| else: | ||
| print(f"✓ Successfully executed {nb_path}") | ||
|
|
||
| if failures: | ||
| print("\n======= Summary =======") | ||
| print(f"Failed notebooks: {failures}") | ||
| sys.exit(1) | ||
| else: | ||
| print("\n✓ All notebooks executed successfully!") | ||
| EOF | ||
|
|
||
| - name: Run Tests | ||
| run: | | ||
| source .venv/bin/activate | ||
| pytest -s -v --cov=./ --cov-report=xml --cov=aurora -n auto tests | ||
|
|
||
| - name: "Upload coverage reports to Codecov" | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
| fail_ci_if_error: false | ||
| flags: tests | ||
|
|
||
| # Note: these conditions won't match python-version 3.10; adjust if desired. | ||
| - name: Build Doc | ||
| if: ${{ (github.ref == 'refs/heads/main') && (matrix.python-version == '3.8') }} | ||
| run: | | ||
| source .venv/bin/activate | ||
| cd docs | ||
| make html | ||
| cd .. | ||
|
|
||
| - name: GitHub Pages | ||
| if: ${{ (github.ref == 'refs/heads/main') && (matrix.python-version == '3.8') }} | ||
| uses: crazy-max/ghaction-github-pages@v2.5.0 | ||
| with: | ||
| build_dir: docs/_build/html | ||
| jekyll: false | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,45 @@ | ||
| # .pre-commit-config.yaml | ||
| repos: | ||
| - repo: https://github.com/ambv/black | ||
| rev: 22.6.0 | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: black | ||
| language_version: python3.10 | ||
| - repo: https://github.com/pycqa/flake8 | ||
| rev: 3.9.2 | ||
| - id: trailing-whitespace | ||
| types: [python] | ||
| - id: end-of-file-fixer | ||
| types: [python] | ||
| - id: check-yaml | ||
| exclude: '^(?!.*\.py$).*$' | ||
|
|
||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.12.0 | ||
| hooks: | ||
| - id: flake8 | ||
| - id: isort | ||
| types: [python] | ||
| exclude: (__init__.py)$ | ||
| files: \.py$ | ||
| args: ["--profile", "black", | ||
| "--skip-glob","*/__init__.py", | ||
| "--force-alphabetical-sort-within-sections", | ||
| "--order-by-type", | ||
| "--lines-after-imports=2"] | ||
|
|
||
| - repo: https://github.com/psf/black | ||
| rev: 23.3.0 | ||
| hooks: | ||
| - id: black | ||
| types: [python] | ||
| files: \.py$ | ||
| language_version: python3 | ||
|
|
||
| - repo: https://github.com/pycqa/autoflake | ||
| rev: v2.1.1 | ||
| hooks: | ||
| - id: autoflake | ||
| types: [python] | ||
| files: \.py$ | ||
| args: [ | ||
| "--remove-all-unused-imports", | ||
| "--expand-star-imports", | ||
| "--ignore-init-module-imports", | ||
| "--in-place" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcapriot I'd be curious about your thoughts on changing tests.yaml to use
uvinstead ofconda. I've been moving toward usinguvfor all my python projects lately. I don't foreseeauroraincorporating C or other code anytime in the near future. Any SimPEG-related drawbacks to this change that I may be missing?