Skip to content

V0.6.1+4lst - #329

Open
Elisa-Visentin wants to merge 24 commits into
masterfrom
v0.6.1+4lst
Open

V0.6.1+4lst#329
Elisa-Visentin wants to merge 24 commits into
masterfrom
v0.6.1+4lst

Conversation

@Elisa-Visentin

Copy link
Copy Markdown
Collaborator

No description provided.

@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.82788% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.64%. Comparing base (aa3ead2) to head (9dfccf6).

Files with missing lines Patch % Lines
magicctapipe/conftest.py 99.42% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #329      +/-   ##
==========================================
+ Coverage   75.89%   79.64%   +3.75%     
==========================================
  Files          22       22              
  Lines        2750     3237     +487     
==========================================
+ Hits         2087     2578     +491     
+ Misses        663      659       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Elisa-Visentin Elisa-Visentin mentioned this pull request Apr 28, 2026
3 tasks
@Elisa-Visentin
Elisa-Visentin marked this pull request as ready for review April 28, 2026 09:27
@Elisa-Visentin

Copy link
Copy Markdown
Collaborator Author

There are probably some tests not actually needed, but we can start to have a look into that to start pruning the 'tree' of 4 LST PRs

telescope_combinations,
)

LOGGER = logging.getLogger(__name__)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this LOGGER does not seem to be used anywhere

@@ -1,11 +1,13 @@
import glob
import logging

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in principle the tests are by default executed with all the text output supressed, do we need this part?

query_test = pd.read_hdf(query_test_1, key="/events/parameters")
data = query_data(query_test, "software", None, [], False)
assert (
'Requested event type and provided telescopes IDs are not consistent; "software" must be used in case of standard MAGIC+LST-1 analyses'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now I see where you use the log, but such a test is dangerous: enough that somebody will change slightly the message and the test will fail. This looks like a fatal error, so we could e.g. throw an exception that can be tested here

query_test = pd.read_hdf(query_test_2, key="/events/parameters")
data = query_data(query_test, "magic_only", None, [], False)
assert (
"MAGIC-only analysis requested, but inconsistent with the provided telescope IDs: check the configuration file"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above - better to e.g. throw an exception that is tested here

data = query_data(query_test, "magic_only", 3, [], False)
assert np.allclose(np.array(data["event_id"]), np.array([2, 5, 8]))

query_test = pd.read_hdf(query_test_2, key="/events/parameters")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there are many lines like this it can be passed as parametrized test or just a loop with input/output values listed in an array/dictionaries

data = query_data(query_test, "trigger_3tels_or_more", None, [4, 5, 6], False)
assert np.allclose(np.array(data["event_id"]), np.array([1, 3, 9]))

query_test = pd.read_hdf(query_test_2, key="/events/parameters")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line (and e.g. in L65) do not seem needed for me since query_test is not expected to change from L55

"LST-1_MAGIC-II": [1, 3], # combo_type = 2
"MAGIC-I_MAGIC-II": [2, 3], # combo_type = 3
}
assert list(M_LST_comb.keys()) == [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is not needed, if you check the whole dictionary the test above will fail already if there is a difference in the keys

"grid_points",
"effective_area",
"energy_dispersion",
"psf_table",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of checking later on that psf_table is not in irf keys, you could simply remove it from here, same with background

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants