Skip to content

Commit

Permalink
add error message
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusOrsoe committed Sep 26, 2023
1 parent 6774e1e commit 40b36ef
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
12 changes: 11 additions & 1 deletion examples/01_icetray/01_convert_i3_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
from graphnet.utilities.imports import has_icecube_package
from graphnet.utilities.logging import Logger

from _common_icetray import ERROR_MESSAGE_MISSING_ICETRAY
ERROR_MESSAGE_MISSING_ICETRAY = (
"This example requires IceTray to be installed, which doesn't seem to be "
"the case. Please install IceTray; run this example in the GraphNeT "
"Docker container which comes with IceTray installed; or run an example "
"script in one of the other folders:"
"\n * examples/02_data/"
"\n * examples/03_weights/"
"\n * examples/04_training/"
"\n * examples/05_pisa/"
"\nExiting."
)

CONVERTER_CLASS = {
"sqlite": SQLiteDataConverter,
Expand Down
12 changes: 11 additions & 1 deletion examples/01_icetray/04_i3_module_in_native_icetray_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@
GraphNeTI3Module,
)

from _common_icetray import ERROR_MESSAGE_MISSING_ICETRAY
ERROR_MESSAGE_MISSING_ICETRAY = (
"This example requires IceTray to be installed, which doesn't seem to be "
"the case. Please install IceTray; run this example in the GraphNeT "
"Docker container which comes with IceTray installed; or run an example "
"script in one of the other folders:"
"\n * examples/02_data/"
"\n * examples/03_weights/"
"\n * examples/04_training/"
"\n * examples/05_pisa/"
"\nExiting."
)


def apply_to_files(
Expand Down
11 changes: 0 additions & 11 deletions examples/01_icetray/_common_icetray.py

This file was deleted.

4 changes: 1 addition & 3 deletions tests/examples/01_icetray/test_icetray_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ def test_03_i3_deployer_example() -> None:
def test_04_i3_module_in_native_icetray_example() -> None:
"""Test for 04_i3_module_in_native_icetray_example."""
runpy.run_path(
os.path.join(
EXAMPLE_PATH, "04_i3_module_in_naticve_icetray_example.py"
)
os.path.join(EXAMPLE_PATH, "04_i3_module_in_native_icetray_example.py")
)

0 comments on commit 40b36ef

Please sign in to comment.