From 898b01e56c5665e10f3851736930f4af245daf67 Mon Sep 17 00:00:00 2001 From: Stefan Reck <stefan.reck@fau.de> Date: Thu, 1 Jul 2021 17:53:16 +0200 Subject: [PATCH] moved toml presets to seperate directory --- .../bundle_ORCA4_corsika_sibyll_2-3c.toml | 0 .../bundle_ORCA4_data_v5-40.toml | 0 .../bundle_ORCA4_mupage_v5-40.toml | 0 docs/getting_started.rst | 4 ++-- orcasong/from_toml.py | 8 ++++---- 5 files changed, 6 insertions(+), 6 deletions(-) rename examples/orcasong_bundle_corsika.toml => configs/bundle_ORCA4_corsika_sibyll_2-3c.toml (100%) rename examples/orcasong_bundle_data.toml => configs/bundle_ORCA4_data_v5-40.toml (100%) rename examples/orcasong_bundle_mupage.toml => configs/bundle_ORCA4_mupage_v5-40.toml (100%) diff --git a/examples/orcasong_bundle_corsika.toml b/configs/bundle_ORCA4_corsika_sibyll_2-3c.toml similarity index 100% rename from examples/orcasong_bundle_corsika.toml rename to configs/bundle_ORCA4_corsika_sibyll_2-3c.toml diff --git a/examples/orcasong_bundle_data.toml b/configs/bundle_ORCA4_data_v5-40.toml similarity index 100% rename from examples/orcasong_bundle_data.toml rename to configs/bundle_ORCA4_data_v5-40.toml diff --git a/examples/orcasong_bundle_mupage.toml b/configs/bundle_ORCA4_mupage_v5-40.toml similarity index 100% rename from examples/orcasong_bundle_mupage.toml rename to configs/bundle_ORCA4_mupage_v5-40.toml diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 612e39c..992acd0 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -30,9 +30,9 @@ If you have an orcasong config file, you can use it via the command line like th For some examples of config files you can check out the git repo here -https://git.km3net.de/ml/OrcaSong/-/tree/master/examples . +https://git.km3net.de/ml/OrcaSong/-/tree/master/configs . These can be loaded from the command line by using the prefix -``orcasong:`` before the filename, e.g. ``orcasong:orcasong_bundle_mupage.toml``. +``orcasong:`` before the filename, e.g. ``orcasong:bundle_ORCA4_data_v5-40.toml``. Alternatively, you can use the python frontend of orcasong. See :ref:`orcasong_page` for instructions on how to do this. diff --git a/orcasong/from_toml.py b/orcasong/from_toml.py index b22bf11..3eb2146 100644 --- a/orcasong/from_toml.py +++ b/orcasong/from_toml.py @@ -28,7 +28,7 @@ def add_parser_run(subparsers): parser.add_argument('infile', type=str, help="Aanet file in h5 format.") parser.add_argument('toml_file', type=str, help=( "Orcasong configuration in toml format. Use prefix 'orcasong:' to load " - "a toml from OrcaSong/examples.")) + "a toml from OrcaSong/configs.")) parser.add_argument('--detx_file', type=str, default=None, help=( "Optional detx file to calibrate on the fly. Can not be used if a " "detx_file has also been given in the toml file.")) @@ -44,7 +44,7 @@ def run_orcasong(infile, toml_file, detx_file=None, outfile=None): def setup_processor(infile, toml_file, detx_file=None): if toml_file.startswith("orcasong:"): - toml_file = _get_from_examples(toml_file[9:]) + toml_file = _get_config(toml_file[9:]) cfg = toml.load(toml_file) processor = _get_verbose(cfg.pop("mode"), MODES) @@ -72,7 +72,7 @@ def _get_verbose(key, d): return d[key] -def _get_from_examples(filename): - direc = os.path.join(Path(orcasong.core.__file__).parents[1], "examples") +def _get_config(filename): + direc = os.path.join(Path(orcasong.core.__file__).parents[1], "configs") files = {file: os.path.join(direc, file) for file in os.listdir(direc)} return _get_verbose(filename, files) -- GitLab