This repository was archived by the owner on Sep 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Sep 7, 2024. It is now read-only.
convert_npy fails silently if no .npy files are found #67
Copy link
Copy link
Open
Description
See TODO, line 24:
nano-oscillator/analysis/geom.py
Lines 12 to 37 in 6452a73
| def convert_npy(date: str = None): | |
| """Converts all .npy files to .tsv files.""" | |
| date = date if date is not None else paths.top.latest_date() | |
| conversion = ["x", "y", "z"] | |
| for file in os.listdir(paths.data.raw(date)): | |
| fields = {} | |
| if file.endswith(".npy"): | |
| #TODO: raise FileNotFoundError | |
| filename = os.path.splitext(file)[0] | |
| write.prep_dir(paths.spatial.geom_dir(filename, date)) | |
| fields[filename] = np.load(os.path.join(paths.data.raw(date), file)) | |
| for component_index in range(len(fields[filename])): | |
| component = conversion[component_index] | |
| for z_index in range(len(fields[filename][component_index])): | |
| pd.DataFrame(np.flip(fields[filename][component_index][z_index])) \ | |
| .to_csv(paths.spatial.spatial_path( | |
| filename, component, z_index, date), sep="\t", index=False | |
| ) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels