Skip to content

Commit

Permalink
feedback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tech3371 committed Nov 20, 2023
1 parent cca1061 commit 8c2d63a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 31 deletions.
Empty file removed imap_processing/hi/l0/__init__.py
Empty file.
21 changes: 0 additions & 21 deletions imap_processing/hi/l0/decom_hi.py

This file was deleted.

21 changes: 11 additions & 10 deletions imap_processing/hi/tests/test_decom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
import pytest

from imap_processing import imap_module_directory
from imap_processing.hi.l0 import decom_hi
from imap_processing.decom import decom_packets


@pytest.fixture(scope="session")
def decom_nhk_data():
"""Read test data from test folder"""
"""Read test housekeeping data from test folder"""
test_folder_path = "hi/tests/l0_test_data"
packet_file = imap_module_directory / f"{test_folder_path}/20231030_H45_APP_NHK.bin"
packet_def_file = imap_module_directory / "hi/packet_definitions/H45_APP_NHK.xml"
return decom_hi.decom_packets(packet_file, packet_def_file)
return decom_packets(packet_file, packet_def_file)


@pytest.fixture(scope="session")
def nhk_validation_data():
"""Read in validation data from the CSV file"""
test_data_path = imap_module_directory / "hi/tests/l0_validation_data"
raw_validation_data = pd.read_csv(

Check warning on line 21 in imap_processing/hi/tests/test_decom.py

View check run for this annotation

Codecov / codecov/patch

imap_processing/hi/tests/test_decom.py#L20-L21

Added lines #L20 - L21 were not covered by tests
test_data_path / "20231030_H45_APP_NHK.csv",
Expand All @@ -26,37 +27,37 @@ def nhk_validation_data():

@pytest.fixture(scope="session")
def decom_sci_de_data():
"""Read test data from test folder"""
"""Read science direct event data from test folder"""
test_folder_path = "hi/tests/l0_test_data"
packet_file = imap_module_directory / f"{test_folder_path}/20231030_H45_SCI_DE.bin"
packet_def_file = imap_module_directory / "hi/packet_definitions/H45_SCI_DE.xml"
return decom_hi.decom_packets(packet_file, packet_def_file)
return decom_packets(packet_file, packet_def_file)


@pytest.fixture(scope="session")
def decom_sci_cnt_data():
"""Read test data from test folder"""
"""Read science count data from test folder"""
test_folder_path = "hi/tests/l0_test_data"
packet_file = imap_module_directory / f"{test_folder_path}/20231030_H45_SCI_CNT.bin"
packet_def_file = imap_module_directory / "hi/packet_definitions/H45_SCI_CNT.xml"
return decom_hi.decom_packets(packet_file, packet_def_file)
return decom_packets(packet_file, packet_def_file)


def test_app_nhk_decom(decom_nhk_data):
"""Test decom_hi.decom_packets"""
"""Test housekeeping data"""
expected_number_of_packets = 100
assert len(decom_nhk_data) == expected_number_of_packets
# TODO: extend test more and check with validation data
# Validation data seems off. TODO: check with IMAP-Hi team


def test_sci_de_decom(decom_sci_de_data):
"""Test decom_hi.decom_packets"""
"""Test science direct event data"""
expected_number_of_packets = 100
assert len(decom_sci_de_data) == expected_number_of_packets


def test_sci_cnt_decom(decom_sci_cnt_data):
"Test SCI_CNT packet"
"Test science count data"
expected_number_of_packets = 100
assert len(decom_sci_cnt_data) == expected_number_of_packets

0 comments on commit 8c2d63a

Please sign in to comment.