Skip to content
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

Features #369

Open
wants to merge 66 commits into
base: patches
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f914a30
Test new pathing for Band object in mt_metadata
kkappler Dec 26, 2024
cb86a49
Reduce number of instances for test and update mt_metadata branch
kkappler Dec 26, 2024
eed21ba
try suppress mtpy-v2 reinstall
kkappler Dec 26, 2024
cb1225e
update import get_fft_harmonics to new path in mt_metadata
kkappler Dec 26, 2024
df77152
replace some calls to decimation attrs with access to time_series_dec…
kkappler Dec 27, 2024
5fa3fe7
change var name and add dtype (local tests pass)
kkappler Dec 27, 2024
4931648
add some dtyping and doc
kkappler Dec 28, 2024
12d4cf4
add doc/notes
kkappler Dec 28, 2024
f0abee1
add TODO
kkappler Dec 28, 2024
f7cc243
add typehint, tests pass locally
kkappler Dec 28, 2024
65732fa
updates for partial compatability with mt_metadata issue 238 (local t…
kkappler Dec 28, 2024
ab90d8b
access recoloring via stft
kkappler Dec 29, 2024
264dfc6
add a variation on tests
kkappler Dec 29, 2024
c21793d
comment out notebooks for clearer error messages
kkappler Dec 29, 2024
503758b
towards mt_metadata 235
kkappler Dec 29, 2024
6e69bca
Update per changes in mt_metadata
kkappler Dec 29, 2024
6a27f92
try another way to make tests pass
kkappler Dec 30, 2024
c0a885d
add test (towards issue #363)
kkappler Dec 31, 2024
41a414b
echo some env info
kkappler Dec 31, 2024
5a630e2
fix typo
kkappler Jan 2, 2025
5b44182
update window imports
kkappler Jan 2, 2025
031202c
towards mth5 spectrograms (partial factoring)
kkappler Jan 2, 2025
14c6507
add TODO and clarify argument
kkappler Jan 2, 2025
f290c61
add some TODOs
kkappler Jan 2, 2025
5dab8b9
factor add_spectrogram_to_mth5 from add_fcs_to_mth5
kkappler Jan 2, 2025
e0601d7
try another way to make tests pass
kkappler Jan 3, 2025
91fbc7b
remane xrts to xrds
kkappler Jan 3, 2025
96b3844
modify tests to preinstall branches of mth5, mt_metadata
kkappler Jan 3, 2025
33e88c4
cleanup yaml
kkappler Jan 3, 2025
914998a
uncommnet ipynb tests
kkappler Jan 4, 2025
80ab668
Merge pull request #367 from simpeg/try_fix_tests
kkappler Jan 4, 2025
8484fb1
Merge pull request #366 from simpeg/fix_mth5_issue_271
kkappler Jan 4, 2025
5fc4a0f
Merge pull request #365 from simpeg/fix_mt_metadata_issue_241
kkappler Jan 4, 2025
a2a10ec
update doc and TODOs
kkappler Jan 4, 2025
831a58f
remove unused sample_rate validation
kkappler Jan 4, 2025
8f9172f
replace decimation.window with decimation.stft.window
kkappler Jan 4, 2025
e0e8e54
apply updates from mt_metadata to access stft attrs
kkappler Jan 4, 2025
2f4a10d
update syntax to new mt_metadata decimation
kkappler Jan 5, 2025
c229015
update ipynb for mt_metadata decimation
kkappler Jan 5, 2025
55557b5
update ipynb for mt_metadata decimation
kkappler Jan 5, 2025
3849b89
update syntax to new mt_metadata decimation
kkappler Jan 5, 2025
ae76455
remove spectrogram (will replace with mth5 Spectrogram)
Jan 6, 2025
aef6c2b
replace aurora's extract_band method with mth5 method
Jan 6, 2025
3ec3ed5
replace apply_prewhitening with mth5 method
Jan 6, 2025
384a08d
replace aurora's apply_recoloring method with mth5's version
Jan 6, 2025
5cd5a84
suppress ipynb from tests
Jan 6, 2025
57e7037
re-add tests
Jan 6, 2025
e7aaf4f
replace –_add_spectrorgrams_to_mth5 with mth5 method
Jan 6, 2025
614c889
replace –read_back_fcs with mth5 method
Jan 6, 2025
286a01e
suppress ipynb tests
Jan 6, 2025
962906e
replace duplicate method with mt_metadata
Jan 6, 2025
13fc2b8
add doc
kkappler Jan 7, 2025
966b911
replace imports from pipelines/fourier_coefficients with mth5
kkappler Jan 7, 2025
3d53ddc
remove fourier_coefficients.py
kkappler Jan 7, 2025
8eb8a24
reenable ipynb tests
kkappler Jan 7, 2025
eaea779
update imports in ipynb
kkappler Jan 7, 2025
9a53fee
replace run_ts_to_stft_scipy with mth5 method
kkappler Jan 7, 2025
07f55a2
add some typehints
kkappler Jan 10, 2025
cba95a2
minor changes to doc
kkappler Jan 10, 2025
b282dc3
update test now that FrequencyBands uses dataframe
kkappler Jan 10, 2025
0166cc6
update name of initialize_xrda_2d to initialize_xrda_2d_cov
kkappler Jan 11, 2025
1235919
remove tests (now in mth5) for initialize_xrda_1d
kkappler Jan 11, 2025
6f84bea
update to use xarray helpers from mth5
kkappler Jan 11, 2025
a2f40ef
update import
kkappler Jan 11, 2025
f1cec92
update flake8 to be consistent with mth5 (80lines)
kkappler Jan 18, 2025
8f5745e
Merge branch 'features' of kkappler-github:simpeg/aurora into features
kkappler Jan 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ ignore = E501, W605, W503, E203, F401, E722
#,E402, E203,E722
#F841, E402, E722
#ignore = E203, E266, E501, W503, F403, F401
max-line-length = 88
max-line-length = 80
max-complexity = 18
select = B,C,E,F,W,T4,B9
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, "3.11"]
# python-version: [3.8, 3.9, "3.10", "3.11"]
# python-version: ["3.10", ]

steps:
Expand All @@ -33,17 +34,19 @@ jobs:
- name: Install Env
run: |
python --version
echo $CONDA_PREFIX
conda install -c conda-forge pytest pytest-cov certifi">=2017.4.17" pandoc
pip install -r requirements-dev.txt
# pip install git+https://github.com/kujaku11/mt_metadata.git@main
# pip install git+https://github.com/kujaku11/mth5.git@master
# pip install git+https://github.com/MTgeophysics/mtpy-v2.git@main
pip install git+https://github.com/kujaku11/mt_metadata.git@features
pip install git+https://github.com/kujaku11/mth5.git@features
pip install git+https://github.com/MTgeophysics/mtpy-v2.git@main
pip uninstall aurora -y

- name: Install Our Package
run: |
echo $CONDA_PREFIX
pip install -e .
echo "Install complete"
conda list
pip freeze

Expand Down
20 changes: 9 additions & 11 deletions aurora/config/config_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from aurora.config.metadata import Processing
from aurora.sandbox.io_helpers.emtf_band_setup import EMTFBandSetupFile

from mt_metadata.transfer_functions.processing.aurora.window import Window
from mt_metadata.transfer_functions.processing.window import Window


SUPPORTED_BAND_SPECIFICATION_STYLES = ["EMTF", "band_edges"]
Expand Down Expand Up @@ -108,9 +108,7 @@ def determine_band_specification_style(self) -> None:
logger.info(msg)
self._emtf_band_file = BANDS_DEFAULT_FILE
self._band_specification_style = "EMTF"
elif (self._emtf_band_file is not None) & (
self._band_edges is not None
):
elif (self._emtf_band_file is not None) & (self._band_edges is not None):
msg = "Bands defined twice, and possibly inconsistently"
logger.error(msg)
raise ValueError(msg)
Expand Down Expand Up @@ -152,6 +150,8 @@ def create_from_kernel_dataset(

Theoretically, you could also use the number of decimations implied by bands_dict but this is sloppy, because it would assume the decimation factor.

3. 2024-12-29 Added setting of decimation_obj.stft.per_window_detrend_type = "linear"
This makes tests pass following a refactoring of mt_metadata. Could use more testing.

Parameters
----------
Expand All @@ -178,9 +178,7 @@ def create_from_kernel_dataset(
Object storing the processing parameters.
"""

processing_obj = Processing(
id=kernel_dataset.processing_id
) # , **kwargs)
processing_obj = Processing(id=kernel_dataset.processing_id) # , **kwargs)

# pack station and run info into processing object
processing_obj.stations.from_dataset_dataframe(kernel_dataset.df)
Expand Down Expand Up @@ -209,9 +207,7 @@ def create_from_kernel_dataset(
decimation_factors[0] = 1
if num_samples_window is None:
default_window = Window()
num_samples_window = num_decimations * [
default_window.num_samples
]
num_samples_window = num_decimations * [default_window.num_samples]
elif isinstance(num_samples_window, int):
num_samples_window = num_decimations * [num_samples_window]
# now you can define the frequency bands
Expand Down Expand Up @@ -241,11 +237,13 @@ def create_from_kernel_dataset(
decimation_obj.output_channels = output_channels

if num_samples_window is not None:
decimation_obj.window.num_samples = num_samples_window[key]
decimation_obj.stft.window.num_samples = num_samples_window[key]
# set estimator if provided as kwarg
if estimator:
try:
decimation_obj.estimator.engine = estimator["engine"]
except KeyError:
pass
decimation_obj.stft.per_window_detrend_type = "linear"

return processing_obj
Loading
Loading