Skip to content

Commit

Permalink
wip: temp fix for single page import for 3, not finished and breaks b…
Browse files Browse the repository at this point in the history
…ack compart
  • Loading branch information
halt9k committed Nov 23, 2023
1 parent 12ea433 commit 6eb7d75
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
5 changes: 4 additions & 1 deletion src/jap_arc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def aggregate_site_headers(eq_table, col_names_mode=False):
elif ext.endswith('2'):
common_high_data = ensure_headers_integrity(common_high_data, expected_same_for_heights)
else:
assert False
if ext in STANDARD:
print('Simple data detected instead of low and high. Skipping low vs high header integrity check.')
else:
assert(False)

if col_names_mode:
update_data += ext
Expand Down
7 changes: 4 additions & 3 deletions src/jap_txt_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ class ExpectedDuplications:
['Station Code', str, ED.SAME_FOR_GEO_SITE],
['Station Lat.', float, ED.SAME_FOR_GEO_SITE],
['Station Long.', float, ED.SAME_FOR_GEO_SITE],
['Station Height(m)', int, ED.SAME_FOR_SEISMOGRAPH_DIRECTIONS],
['Record Time', datetime, ED.SAME_FOR_SEISMOGRAPH_DIRECTIONS],
# TODO 4 critical: brokes support of previous imports; check commit history
['Station Height(m)', int, ED.SAME_FOR_GEO_SITE],
['Record Time', datetime, ED.SAME_FOR_GEO_SITE],
[HEADER_FREQ, str, ED.SAME_FOR_GEO_SITE],
['Duration Time(s)', int, ED.SAME_FOR_GEO_SITE],
['Dir.', str, ED.EXPECTED_ANY],
[HEADER_SCALE, str, ED.SAME_FOR_SEISMOGRAPH_DIRECTIONS],
[HEADER_SCALE, str, ED.SAME_FOR_GEO_SITE],
['Max. Acc. (gal)', float, ED.EXPECTED_ANY],
['Last Correction', datetime, ED.EXPECTED_ANY],
[HEADER_END, str, ED.EXPECTED_ANY],
Expand Down
Binary file not shown.
16 changes: 6 additions & 10 deletions tests/test_import_only_3/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ask_archive = no
default_arc_paths = .\data\

ask_xls_template = no
default_xls_template = .\Demo Excel template v11.xlsx
default_xls_template = .\100Hz PGA header template.xlsx

[Excel import]

Expand All @@ -21,7 +21,7 @@ default_xls_template = .\Demo Excel template v11.xlsx
# combines headers from multiple archives into same excel page
# import_mode = multiple_pages
# each archive is imported into new excel page
import_mode = multiple_pages
import_mode = single_page

header_final_order = [
"Origin Time",
Expand All @@ -32,16 +32,12 @@ header_final_order = [
"Station Code",
"Station Lat.",
"Station Long.",
"Station Height(m).EW1",
"Station Height(m)",
"Sampling Freq(Hz)",
"Duration Time(s)",
"Max. Acc. (gal).EW1",
"Station Height(m).EW2",
"Max. Acc. (gal).EW2",
"Max. Acc. (gal).NS1",
"Max. Acc. (gal).NS2",
"Max. Acc. (gal).UD1",
"Max. Acc. (gal).UD2"
"Max. Acc. (gal).EW",
"Max. Acc. (gal).NS",
"Max. Acc. (gal).UD"
]

[UX]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ def test_batch_headers_inconsistent_data(self, use_fixture_path, src_path):
@pytest.mark.parametrize('src_path', [Path('./tests/test_import_only_3')])
def test_import_only_3(self, use_fixture_path, src_path):
main()
new_file = list(Path().glob('./data/sites/IBRH17/Imported_*.xlsx'))[0]
new_file = list(Path().glob('./data/Imported_*.xlsx'))[0]
assert(get_sheet_count(new_file) == 1)

0 comments on commit 6eb7d75

Please sign in to comment.