Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Add in condition to look for x, y or z in the name #69

Open
anweiteck opened this issue Jan 8, 2022 · 2 comments
Open

Add in condition to look for x, y or z in the name #69

anweiteck opened this issue Jan 8, 2022 · 2 comments
Assignees

Comments

@anweiteck
Copy link
Collaborator

See TODO, line 277:

except FileNotFoundError as err:
if len(
os.listdir(os.path.join(anl.paths.spatial.root(DATE), filename))
) > 0:
#TODO: add in condition to look for x, y or z in the name
print(
f"{component} not found for {filename}. Component skipped.")
else:
raise err
else:
print("Skipped.")

@anweiteck anweiteck self-assigned this Jan 8, 2022
@qitianshi qitianshi changed the title add in condition to look for x, y or z in the name Add in condition to look for x, y or z in the name Jan 8, 2022
@qitianshi
Copy link
Owner

Changed in 0f08bf0.

except FileNotFoundError:
print(f"{component} not found for {filename}. Component skipped.")
#TODO: Check that it's only the singular component that is not found.
# Otherwise the error should still be raised.

@qitianshi
Copy link
Owner

qitianshi commented Jan 11, 2022

Probably best to extract all the unique quantities in the directory using os.listdir (before the loop), then for each in QUANTITIES check if it exists. Otherwise you can probably use os.path.exists to check if the other two components exist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants