Skip to content
This repository was archived by the owner on Sep 7, 2024. It is now read-only.
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

@anweiteck

Description

@anweiteck

See TODO, line 24:

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
)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions