Skip to content

Commit

Permalink
Merge pull request #179 from cta-observatory/fix_tests
Browse files Browse the repository at this point in the history
added new tests
  • Loading branch information
Elisa-Visentin authored Jan 19, 2024
2 parents aaf9c9b + e88ba0d commit fc69dba
Show file tree
Hide file tree
Showing 8 changed files with 1,039 additions and 954 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
MAGIC_CTA_DATA_USER: ${{ secrets.magic_cta_data_user }}
MAGIC_CTA_DATA_PASSWORD: ${{ secrets.magic_cta_data_password }}
run: |
coverage run -m pytest -v
coverage run -m pytest -vra
coverage xml
- uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies:
- psutil
- pytest
- pytest-cov
- pytest-dependency
- pytest-runner
- pyyaml
- scikit-learn=1.2
Expand Down
13 changes: 3 additions & 10 deletions magicctapipe/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,6 @@ def config_calib():
return config


@pytest.fixture(scope="session")
def config_check():
config_path = resource_file("test_check_list.yaml")
with open(config_path, "rb") as f:
config = yaml.safe_load(f)
return config


"""
Data processing
"""
Expand Down Expand Up @@ -540,6 +532,7 @@ def p_l1_monly(temp_DL1_p_monly, dl0_p, config_monly):
"""
Produce a DL1 file
"""

for file in dl0_p:
subprocess.run(
[
Expand Down Expand Up @@ -1041,7 +1034,7 @@ def real_index(real_dl3):
f"-i{str(real_dl3)}",
]
)
return temp_DL3
return real_dl3


@pytest.fixture(scope="session")
Expand All @@ -1056,4 +1049,4 @@ def real_index_monly(real_dl3_monly):
f"-i{str(real_dl3_monly)}",
]
)
return temp_DL3_monly
return real_dl3_monly
8 changes: 0 additions & 8 deletions magicctapipe/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,6 @@ def recursive_solution(current_tel, current_comb):

for key in range(len(keys)):
recursive_solution(key, ["", []])
values = list(TEL_NAMES.values()) # TODO: remove in next PR
if set(values) == set(["LST-1", "MAGIC-I", "MAGIC-II"]): # TODO: remove in next PR
TEL_COMBINATIONS = {
"M1_M2": [2, 3], # combo_type = 0
"LST1_M1": [1, 2], # combo_type = 1
"LST1_M2": [1, 3], # combo_type = 2
"LST1_M1_M2": [1, 2, 3], # combo_type = 3
} # WARNING: the IDs provided in the configuration file must be the standard ones in this case. (LST1, M1, M2) = (1, 2, 3)
return TEL_NAMES, TEL_COMBINATIONS


Expand Down
Loading

0 comments on commit fc69dba

Please sign in to comment.