Conversation
Replaced deprecated np.NaN and np.NAN with np.nan in estimate_tf_quality_factor.py. Updated type checking in gis_tools.py for input validation. Added mtpy_data to test dependencies in pyproject.toml. Removed an obsolete test from test_mt.py and added a new test data file.
Introduces a comprehensive pytest-based test suite for the MT class, including fixtures in conftest.py for reusable test data and a new test module covering initialization, impedance handling, phase tensor calculations, tipper data, DataFrame conversions, and edge cases. Tests are organized for efficient execution and parallelization.
Introduces a new pytest-based test module for MTStations and MTLocation, covering grid and profile layouts, coordinate transformations, multi-EPSG handling, edge cases, performance, and integration workflows. The tests use fixtures for setup and are optimized for parallel execution.
Added new pytest test modules for MTDataFrame and MTLocation, including extensive parameterized and fixture-based tests for core functionality, edge cases, and integration. Renamed test_mt_interpolation.py to test_mt_interpolation_pytest.py for consistency with pytest naming.
Corrects the logic in MTData.rotate to set data_rotation_angle on the correct object depending on the inplace flag. Adds a comprehensive pytest-based test suite for MTData covering initialization, properties, rotation, station management, and edge cases.
Introduces a comprehensive pytest suite for the MTCollection class in tests/core/test_mt_collection_pytest.py, covering basic functionality, edge cases, and dataframe operations. Adds extensive caching and worker-safe fixture infrastructure to tests/conftest.py to optimize test performance and compatibility with pytest-xdist, including global cache management and session-scoped fixtures for various MTCollection configurations.
Modified test fixtures in conftest.py to yield (mc, None) instead of just mc, and to open collections in append ('a') mode instead of read ('r') mode. Updated the add_tf call to include tf_id_extra. Adjusted the test in test_mt_collection_pytest.py to unpack the fixture accordingly. These changes support testing the tf_id_extra functionality and ensure collections are opened with write access during tests.
Deduplicate TF file paths in get_tf_file_list to prevent repeated additions. Ensure test HDF5 files are deleted before creation to avoid accumulation. Update fixtures to open collections in read-only mode. Fix dataframe and station count assertions to use unique tf_id and keys for accurate row and station counts.
Changed test fixtures to open MTCollection in append mode ('a') instead of read-only ('r') to allow writing estimate metadata. Added logic to drop duplicate transfer functions by 'tf_id' in the working dataframe to ensure downstream tests see only one entry per TF file.
Refactored test fixtures to use a shared cache mechanism and avoid HDF5 file locking issues, especially on Windows. Added logic to skip global cache creation on pytest-xdist workers and improved error handling for cache creation failures. Updated tests to correctly handle worker-specific filenames and optimized data consistency checks for speed.
Replaces the previous global cache and worker-local file infrastructure for MTCollection test fixtures with a more efficient, session-scoped and class-scoped fixture approach. MTCollection files are now created once per session and copied as needed for test isolation, significantly reducing redundant collection creation and improving pytest-xdist compatibility. Removes legacy cache and lockfile logic, and updates tests to use the new fixture structure for improved performance and maintainability.
Introduces a global MTCollection cache to be shared across all test workers, improving performance by avoiding redundant collection creation. Each worker now receives a copy of the global cache for thread safety. Updates related fixtures and cleanup logic to support the new caching mechanism.
Introduces a comprehensive pytest test suite for the PhaseTensor class, covering empty initialization, impedance data, multiple periods, asymmetric cases, and various error configurations. This improves test coverage and ensures correct behavior of PhaseTensor properties and error handling.
Introduces a comprehensive test suite for the TFBase class using pytest. Tests cover initialization with various data, validation methods, rotation, interpolation (including NaN handling), and additional features to ensure robust functionality.
Introduces comprehensive pytest test cases for the Tipper class, covering initialization, property calculations, error handling, rotation, copy functionality, and frequency/period relationships. These tests improve coverage and reliability of the Tipper implementation.
Migrated tests/imaging/test_plot_mt_response.py from unittest to pytest, added fixtures for parallel safety, expanded test coverage with parametrization and mocking, and improved test isolation and cleanup. Also updated expected values in tests/utils/test_emtf_quality_factors.py for TF_AVG_TIPPER and TF_EDI_RHO_ONLY to match new quality factor calculations.
Converted the test suite for MT transfer function quality factor estimation from unittest to pytest. Added fixtures for test data and MT objects, parametrized tests for various TF files, and expanded coverage to include edge cases, consistency, robustness, and parallel safety. Suppressed expected warnings in EMTFStats for poor quality data and improved DataFrame assignment logic.
Merged pytest-based tests from test_shapefile_creator_pytest.py into test_shapefile_creator.py, significantly expanding coverage for ShapefileCreator. Removed the duplicate pytest file and renamed test_raster_tools_pytest.py to test_raster_tools.py for consistency.
Added installation of pytest-xdist[psutil] and updated the pytest command to use '-n auto' for parallel test execution in the Conda workflow. This should speed up test runs in CI.
Switches to installing test dependencies via pip with the '.[test]' extra instead of separate conda installs for pytest and related packages. Removes installation of mtpy_data and streamlines setup for testing.
Introduces session-scoped MTCollection fixture to avoid repeated expensive setup, adds pytest markers for slow, integration, unit, and plotting tests, and configures matplotlib for headless testing. Updates test modules to use new fixtures and markers, improving test performance and organization. Also ensures matplotlib figures are cleaned up after tests to prevent memory leaks.
Corrects the order of arguments in assertions using pytest.approx to ensure the tested value is on the left and the approximation is on the right. This improves clarity and correctness in test comparisons for quality factor calculations.
Increased relative tolerance from 1e-2 to 5e-2 in pytest.approx assertions for quality factor tests to reduce sensitivity to minor floating point differences. Updated expected values for TF_AVG_TIPPER and TF_EDI_RHO_ONLY to match current outputs.
Switches to Mamba for faster environment creation, adds caching for the conda environment, and replaces pip with uv for package installation in the GitHub Actions workflow. These changes aim to speed up CI runs and improve reliability.
Simplified the GitHub Actions workflow by removing custom package extraction and using 'mamba env create' directly. Updated environment.yml to allow any numpy version and require python>=3.11 for improved compatibility.
Replaces 'conda-channels' with 'channels' and adds 'channel-priority: strict' in the testing_in_conda.yml workflow to align with updated conda-incubator/setup-miniconda action parameters.
Removed the 'defaults' channel and the python version specification from the environment.yml file to streamline dependency management.
Introduces a concurrency group to the GitHub Actions workflow to ensure that only one run per branch or PR is active at a time, cancelling any in-progress runs. This helps prevent redundant or conflicting workflow executions.
Added several geospatial and scientific libraries including scipy, xarray, pyproj, configparser, geopandas, rasterio, contextily, and pyevtk. Reordered some dependencies for clarity.
Added a new failing_tests_log.txt file to track test failures. Updated tests/processing/aurora/test_aurora_processing.py, possibly to address or log additional test information.
Changed the default value of add_coherence_weights from True to False in _set_decimation_level_parameters to alter the default processing behavior.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
==========================================
+ Coverage 33.60% 41.20% +7.60%
==========================================
Files 143 148 +5
Lines 24114 27210 +3096
==========================================
+ Hits 8104 11213 +3109
+ Misses 16010 15997 -13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Update code to work with newer versions of mth5 and mt_metadata.