Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #126 from qitianshi/107-erroneous-imports
Browse files Browse the repository at this point in the history
Resolve #107
  • Loading branch information
qitianshi authored Apr 4, 2022
2 parents 7fcc91f + db68a2b commit e0ae154
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions analysis/oscil.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@

import numpy as np

import analysis as anl
from analysis import paths, write


def load_npy(date: str = None):
"""Returns npy files as dict of numpy arrays with filename as key."""

date = date if date is not None else anl.paths.top.latest_date()
date = date if date is not None else paths.top.latest_date()

fields = {}

for file in os.listdir(anl.paths.data.raw(date)):
for file in os.listdir(paths.data.raw(date)):

if file.endswith(".npy"):

#TODO: raise FileNotFoundError

filename = os.path.splitext(file)[0]
anl.write.prep_dir(anl.paths.spatial.geom_dir(filename, date))
write.prep_dir(paths.spatial.geom_dir(filename, date))

fields[filename] = np.load(os.path.join(anl.paths.data.raw(date), file))
fields[filename] = np.load(os.path.join(paths.data.raw(date), file))

return fields

0 comments on commit e0ae154

Please sign in to comment.