From 5971508caba1e1e36fde42f313ca4a9243e5889f Mon Sep 17 00:00:00 2001 From: Marcel Office Desktop Date: Thu, 29 Aug 2024 16:34:37 +0200 Subject: [PATCH] [bugfix] Metadata object did not find inventory for relative directory paths/unescaped backslashes --- pylot/core/util/dataprocessing.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pylot/core/util/dataprocessing.py b/pylot/core/util/dataprocessing.py index 09d2ba13..19bed851 100644 --- a/pylot/core/util/dataprocessing.py +++ b/pylot/core/util/dataprocessing.py @@ -27,6 +27,10 @@ class Metadata(object): # saves which metadata files are from obspy dmt self.obspy_dmt_invs = [] if inventory: + # make sure that no accidental backslashes mess up the path + if isinstance(inventory, str): + inventory = inventory.replace('\\', '/') + inventory = os.path.abspath(inventory) if os.path.isdir(inventory): self.add_inventory(inventory) if os.path.isfile(inventory):