-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from kujaku11/patches
Patches
- Loading branch information
Showing
7 changed files
with
96 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 0.3.2 | ||
current_version = 0.3.3 | ||
files = setup.py mt_metadata/__init__.py README.md tests/tf/io/edi/test_no_error_edi.py | ||
commit = True | ||
tag = True |
This file contains 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 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 |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
|
||
__author__ = """Jared Peacock""" | ||
__email__ = "[email protected]" | ||
__version__ = "0.3.2" | ||
__version__ = "0.3.3" | ||
|
||
# ============================================================================= | ||
# Imports | ||
|
This file contains 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 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 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 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,84 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Fri Mar 25 11:46:46 2022 | ||
@author: jpeacock | ||
""" | ||
|
||
# ============================================================================= | ||
# Imports | ||
# ============================================================================= | ||
import pandas as pd | ||
import unittest | ||
|
||
from mt_metadata.transfer_functions.processing.aurora import Processing | ||
|
||
# ============================================================================= | ||
|
||
|
||
class TestProcessing(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(self): | ||
starts = ["2020-01-01T00:00:00", "2020-02-02T00:00:00"] | ||
ends = ["2020-01-31T12:00:00", "2020-02-28T12:00:00"] | ||
|
||
data_list = [] | ||
for ii in range(3): | ||
for start, end in zip(starts, ends): | ||
entry = { | ||
"station_id": "mt01", | ||
"run_id": f"{ii:03}", | ||
"start": start, | ||
"end": end, | ||
"mth5_path": r"/home/mth5_path.h5", | ||
"sample_rate": 10, | ||
"input_channels": ["hx", "hy"], | ||
"output_channels": ["hz", "ex", "ey"], | ||
"remote": False | ||
} | ||
|
||
data_list.append(entry) | ||
|
||
rr_entry_01 = { | ||
"station_id": "rr01", | ||
"run_id": f"{ii:03}", | ||
"start": start, | ||
"end": end, | ||
"mth5_path": r"/home/mth5_path.h5", | ||
"sample_rate": 10, | ||
"input_channels": ["hx", "hy"], | ||
"output_channels": ["hz", "ex", "ey"], | ||
"remote": True | ||
} | ||
data_list.append(rr_entry_01) | ||
|
||
rr_entry_02 = { | ||
"station_id": "rr02", | ||
"run_id": f"{ii:03}", | ||
"start": start, | ||
"end": end, | ||
"mth5_path": r"/home/mth5_path.h5", | ||
"sample_rate": 10, | ||
"input_channels": ["hx", "hy"], | ||
"output_channels": ["hz", "ex", "ey"], | ||
"remote": True | ||
} | ||
data_list.append(rr_entry_02) | ||
data_list = data_list | ||
df = pd.DataFrame(data_list) | ||
df.start = pd.to_datetime(df.start) | ||
df.end = pd.to_datetime(df.end) | ||
self.df = df | ||
|
||
|
||
def test_stations_to_dataframe(self): | ||
""" This could be moved under test_statons.py""" | ||
p = Processing() | ||
p.stations.from_dataset_dataframe(self.df) | ||
df = p.stations.to_dataset_dataframe() | ||
assert len(df) == len(self.df) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |