Skip to content

Commit

Permalink
Adjust verbosity for normal operations (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlincett committed Sep 25, 2023
1 parent cb27499 commit ca7d85e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
12 changes: 8 additions & 4 deletions flarestack/cluster/submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,15 @@ def _clean_injection_values_and_pickled_results(name):
"""
directories = [name_pickle_output_dir(name), inj_dir_name(name)]
for d in directories:
if os.path.isdir(d):
logger.debug(f"removing {d}")
shutil.rmtree(d)
dpath = Path(d)
if dpath.exists():
if dpath.is_dir():
logger.info(f"removing {d}")
shutil.rmtree(d)
else:
logger.warning(f"Can not remove {d}! It is not a directory!")
else:
logger.warning(f"Can not remove {d}! It is not a directory!")
logger.debug(f"Directory {d} does not exist (yet).")

def do_asimov_scale_estimation(self):
"""estimate the injection scale using Asimov estimation"""
Expand Down
2 changes: 1 addition & 1 deletion flarestack/data/icecube/ic_season.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
logger.warning(f"No 10yr sensitivity found at {ref_10yr_path}")
ref_10yr = None
else:
logger.info(
logger.debug(
"Local dataset directory not found. Assuming we are running on an supported datacenter (WIPAC, DESY), I will try to fetch the data from central storage."
)

Expand Down
3 changes: 2 additions & 1 deletion flarestack/data/icecube/ps_tracks/ps_v004_p00.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

sample_name = "ps_tracks_v004_p00"

logger.warning(
# This dataset should be removed right away.
logger.debug(
f"{sample_name}: This dataset is known to have errors in the good run list (GRL). Consider updating to PSTracks v4.1 or v4.2"
)

Expand Down
7 changes: 4 additions & 3 deletions flarestack/icecube_utils/dataset_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ def grl_loader(season):
logger.error(grl[~grl["good_i3"]])
raise Exception("Runs marked as 'bad' are found in Good Run List")
except ValueError:
logger.warning(
"No field called 'good_i3' found in GoodRunList. "
"Cannot check if all runs in GoodRunList are actually good."
# It seems now good_i3 field is deprecated?
logger.debug(
"No field called 'good_i3' found in GoodRunList."
"Assuming that all runs in GoodRunList are actually good."
)

if "length" not in grl.dtype.names:
Expand Down
4 changes: 2 additions & 2 deletions flarestack/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@

for dirname in all_dirs:
if not os.path.isdir(dirname):
logger.info("Making Directory: {0}".format(dirname))
logger.debug("Making Directory: {0}".format(dirname))
os.makedirs(dirname)
else:
logger.info("Found Directory: {0}".format(dirname))
logger.debug("Found Directory: {0}".format(dirname))

# ==============================================================================
# Check host and specify path to dataset storage
Expand Down

0 comments on commit ca7d85e

Please sign in to comment.