-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests #141
Conversation
directories creation (downloads)
Still failed tests? Added MAGIC-only tests (separated from the joint analysis ones) Added input variable to magic_calib_to_dl1.py: maximum number of showers processed -> still 13000 showers to be processed in case of joint analysis: maybe adding another variable to 'shrink' MAGIC files up to approx. 500/1000 showers? Any other suggestion, error...? |
now it works like a charm for me, no broken tests any more |
Duration of individual tests (after all the files are downloaded):
|
is it normal that download takes ages? what is the total size of the files? |
Great. Calibrated MAGIC data still require a few minutes to be processed,
but no coincident event can be found if we process less than 13000 showers
(13500= number of events in the subrun), so, 2 options:
1) Wait
2) Modify a bit the MCP script that processed them to allow it to process
only a range of events (e.g., from 12000 to 13000).
As for the other tests, they have to process data from DL0 up to DL1-stereo
(or DL2) and to apply, e.g., the get_dl2_mean, so a lot of algorithms have
to be applied... (and we cannot use smaller MC p files because we discard a
lot of p events during the analysis and we need them up to DL2)
Il giorno mar 11 lug 2023 alle ore 10:24 Julian Sitarek <
***@***.***> ha scritto:
… Duration of individual tests (after all the files are downloaded):
306.54s setup magicctapipe/io/tests/test_io.py::test_load_magic_dl1_data_files
151.37s setup magicctapipe/io/tests/test_io.py::test_get_stereo_events_mc
47.05s setup magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file
27.61s setup magicctapipe/io/tests/test_io.py::test_get_stereo_events_data
13.91s setup magicctapipe/io/tests/test_io.py::test_index
8.61s setup magicctapipe/io/tests/test_io.py::test_load_dl2_data_file
6.58s setup magicctapipe/io/tests/test_io.py::test_load_irf_files
1.21s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_avg
0.58s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_mc
0.57s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_mc_cut
0.36s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file
0.35s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file_cut
0.34s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file_opt
0.22s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file_exc
0.22s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file
0.21s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file_opt
0.21s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file_cut
0.16s call magicctapipe/io/tests/test_io.py::test_load_train_data_files_off
0.15s call magicctapipe/io/tests/test_io.py::test_load_train_data_files_g
0.13s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_exc
0.13s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_real
0.12s call magicctapipe/io/tests/test_io.py::test_load_train_data_files_p
0.12s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_mc
0.11s call magicctapipe/io/tests/test_io.py::test_load_lst_dl1_data_file
0.11s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file_exc
0.10s call magicctapipe/io/tests/test_io.py::test_load_magic_dl1_data_files
0.09s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_data
0.09s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_data_cut
0.04s teardown magicctapipe/io/tests/test_io.py::test_index
0.03s call magicctapipe/io/tests/test_io.py::test_load_irf_files
0.02s setup magicctapipe/io/tests/test_io.py::test_get_dl2_mean_avg
0.01s call magicctapipe/io/tests/test_io.py::test_save_pandas_data_in_table
—
Reply to this email directly, view it on GitHub
<#141 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A43O4NDXR7OQI2EQVGXDDQTXPUEVRANCNFSM6AAAAAAXY732XA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
------------------------
Indirizzo istituzionale di posta elettronica
degli studenti e dei laureati dell'Università di TorinoOfficial University
of Turin email address for students and graduates
|
The total size is < 500 MB, but the download is not really efficient (and
it depends on the IT Container status, on the ssh connection...
Il giorno mar 11 lug 2023 alle ore 11:24 Elisa Visentin <
***@***.***> ha scritto:
… Great. Calibrated MAGIC data still require a few minutes to be processed,
but no coincident event can be found if we process less than 13000 showers
(13500= number of events in the subrun), so, 2 options:
1) Wait
2) Modify a bit the MCP script that processed them to allow it to process
only a range of events (e.g., from 12000 to 13000).
As for the other tests, they have to process data from DL0 up to
DL1-stereo (or DL2) and to apply, e.g., the get_dl2_mean, so a lot of
algorithms have to be applied... (and we cannot use smaller MC p files
because we discard a lot of p events during the analysis and we need them
up to DL2)
Il giorno mar 11 lug 2023 alle ore 10:24 Julian Sitarek <
***@***.***> ha scritto:
> Duration of individual tests (after all the files are downloaded):
>
> 306.54s setup magicctapipe/io/tests/test_io.py::test_load_magic_dl1_data_files
> 151.37s setup magicctapipe/io/tests/test_io.py::test_get_stereo_events_mc
> 47.05s setup magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file
> 27.61s setup magicctapipe/io/tests/test_io.py::test_get_stereo_events_data
> 13.91s setup magicctapipe/io/tests/test_io.py::test_index
> 8.61s setup magicctapipe/io/tests/test_io.py::test_load_dl2_data_file
> 6.58s setup magicctapipe/io/tests/test_io.py::test_load_irf_files
> 1.21s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_avg
> 0.58s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_mc
> 0.57s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_mc_cut
> 0.36s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file
> 0.35s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file_cut
> 0.34s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file_opt
> 0.22s call magicctapipe/io/tests/test_io.py::test_load_mc_dl2_data_file_exc
> 0.22s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file
> 0.21s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file_opt
> 0.21s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file_cut
> 0.16s call magicctapipe/io/tests/test_io.py::test_load_train_data_files_off
> 0.15s call magicctapipe/io/tests/test_io.py::test_load_train_data_files_g
> 0.13s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_exc
> 0.13s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_real
> 0.12s call magicctapipe/io/tests/test_io.py::test_load_train_data_files_p
> 0.12s call magicctapipe/io/tests/test_io.py::test_get_dl2_mean_mc
> 0.11s call magicctapipe/io/tests/test_io.py::test_load_lst_dl1_data_file
> 0.11s call magicctapipe/io/tests/test_io.py::test_load_dl2_data_file_exc
> 0.10s call magicctapipe/io/tests/test_io.py::test_load_magic_dl1_data_files
> 0.09s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_data
> 0.09s call magicctapipe/io/tests/test_io.py::test_get_stereo_events_data_cut
> 0.04s teardown magicctapipe/io/tests/test_io.py::test_index
> 0.03s call magicctapipe/io/tests/test_io.py::test_load_irf_files
> 0.02s setup magicctapipe/io/tests/test_io.py::test_get_dl2_mean_avg
> 0.01s call magicctapipe/io/tests/test_io.py::test_save_pandas_data_in_table
>
> —
> Reply to this email directly, view it on GitHub
> <#141 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A43O4NDXR7OQI2EQVGXDDQTXPUEVRANCNFSM6AAAAAAXY732XA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
------------------------
Indirizzo istituzionale di posta elettronica
degli studenti e dei laureati dell'Università di TorinoOfficial University
of Turin email address for students and graduates
|
Just tried now, and everything is fine except for gamma_stereo = (PosixPath('/tmp/pytest-of-aberti/pytest-2/DL1_gamma_train0'), PosixPath('/tmp/pytest-of-aberti/pytest-2/DL1_gamma_test0'))
def test_load_train_data_files_off(gamma_stereo):
"""
Check off-axis cut
"""
events = load_train_data_files(
str(gamma_stereo[0]), offaxis_min="0.2 deg", offaxis_max="0.5 deg"
)
> data = events["LST1_M2"]
E KeyError: 'LST1_M2'
magicctapipe/io/tests/test_io.py:111: KeyError
------------------------------------------------------------ Captured log call -------------------------------------------------------------
INFO magicctapipe.io.io:io.py:493
The following DL1-stereo data files are found:
INFO magicctapipe.io.io:io.py:498 /tmp/pytest-of-aberti/pytest-2/DL1_gamma_train0/dl1_stereo_gamma_zd_16.087deg_az_108.0deg_LST-1_MAGIC_run201.h5
INFO magicctapipe.io.io:io.py:498 /tmp/pytest-of-aberti/pytest-2/DL1_gamma_train0/dl1_stereo_gamma_zd_16.087deg_az_108.0deg_LST-1_MAGIC_run301.h5
INFO magicctapipe.io.io:io.py:133
In total 7 stereo events are found:
INFO magicctapipe.io.io:io.py:170 M1_M2 (type 0): 0 events (0.0%)
LST1_M1 (type 1): 2 events (28.6%)
LST1_M2 (type 2): 0 events (0.0%)
LST1_M1_M2 (type 3): 5 events (71.4%) By the way, I had to change the IP in |
Thank you @aleberti ! |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #141 +/- ##
=========================================
Coverage ? 36.63%
=========================================
Files ? 45
Lines ? 5238
Branches ? 0
=========================================
Hits ? 1919
Misses ? 3319
Partials ? 0 ☔ View full report in Codecov by Sentry. |
ok, now tests are passing, but somehow I am a bit puzzled. The test that is failing for me, never failed in the CI tests here. What failed was the one loading IRF files, where a key called About the test failing for me, indeed changing the intensity cut can work. In order to make this easier, I will include the configuration files used in the tests directly in the repository, and not download them from the web server. It will make easier to do changes if in the future we change something in configuration files. |
Ok, implemented to have the configuration files in the repository. I tried a few intensity cuts (even simply >0), but nothing, I always get the same failing test offline. I wonder how it is possible that here it was not failing. Apart from that, everything else is ok. @jsitarek , @Elisa-Visentin , if you are ok with this, I would say it can be merged. |
As for the IRF test failing... I implemented the test functions by using
the SW school pipeline, but a few weeks ago a PR about IRF implementation
was merged. I changed the config file, but I missed the added key
(sorry!!!) so maybe the file_names key must be added in the test (I will
check it now). According to the version you are using, the test will pass
or fail. Before merging, I can check this (any other recent major change?)
Il mar 22 ago 2023, 13:49 Alessio Berti ***@***.***> ha
scritto:
… Ok, implemented to have the configuration files in the repository. I tried
a few intensity cuts (even simply >0), but nothing, I always get the same
failing test offline. I wonder how it is possible that here it was not
failing. Apart from that, everything else is ok. @jsitarek
<https://github.com/jsitarek> , @Elisa-Visentin
<https://github.com/Elisa-Visentin> , if you are ok with this, I would
say it can be merged.
—
Reply to this email directly, view it on GitHub
<#141 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A43O4NE5HSZVYPMDA6YPVH3XWSMDDANCNFSM6AAAAAAXY732XA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
------------------------
Indirizzo istituzionale di posta elettronica
degli studenti e dei laureati dell'Università di TorinoOfficial University
of Turin email address for students and graduates
|
No worries, I already added the needed key in the IRF test. The test failing for me (but only offline), is another one (see a few comments above), but it is not failing here in the CI. |
As for the merging... the coincidence algorithm has been re-implemented since the creation of this branch, so some merge conflicts will have to be solved (and maybe the configuration files read by the tests will have to be changed a bit: 2 lines were added), but the tests should work. BTW, while implementing these tests I did not changed the MCP coincidence script, I only added some files and modified a bit the maigc_calib_to_dl1, not modified in the master since February...). |
New coincidence algorithm
New coincidence algotithm
Easy to see if tests work in master: merge it in this branch. And indeed they work. |
@jsitarek if you also are ok with the PR now, feel free to merge it! |
This reverts commit a9f5967.
Tried to update the CI file with some updated stuff, but better to do it in another PR. So I reverted the changes. I will not touch this PR anymore :) |
Implementation of tests
Here some test functions (for the
io
module): real data and MCs are processed from DL0s up to DL3s/IRFs and provided to theload
functions. Still to be adapted to the 4LSTs updates and to Git workflows (and maybe to the ctapipe 0.19 upgrades); now they can be run 'locally'. Test files now in my workspace on the IT Container; they will then be moved to a location providing, e.g.,wget
downloads with Git secrets.In the meanwhile...
Comments? suggestions? errors?
Somebody wants to try to run them? (Maybe I need to tell you how to do this...)
See also #137
STILL NOT TO BE MERGED (Maybe after the 4LSTs upgrades)