Skip to content
Snippets Groups Projects
Commit 5e9eb6e5 authored by Michael Langguth's avatar Michael Langguth
Browse files

Correction of check for datetime-object in preprocess_data_step2.py

.
parent 5c0f3e79
Branches
Tags
No related merge requests found
......@@ -71,7 +71,7 @@ class ERA5Pkl2Tfrecords(ERA5Dataset):
"""
Get the corresponding statistics file
"""
method = ERA5Pkl2Tfrecords.get_stat_file.__name__
method = ERA5Pkl2Tfrecords.get_stats_file.__name__
stats_file = os.path.join(os.path.dirname(self.input_dir), "statistics.json")
print("Opening json-file: {0}".format(stats_file))
......@@ -120,7 +120,7 @@ class ERA5Pkl2Tfrecords(ERA5Dataset):
sequences = np.array(sequences)
# sanity checks
assert sequences.shape[0] == len(t_start_points), "%{0}: Lengths of sequence differs from length of t_start_points.".format(method)
assert type(t_start_points[0]) == datetime.datetime, "%{0}: Elements of t_start_points must be datetime-objects.".format(method)
assert isinstance(t_start_points[0], datetime.datetime), "%{0}: Elements of t_start_points must be datetime-objects.".format(method)
with tf.python_io.TFRecordWriter(output_fname) as writer:
for i in range(len(sequences)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment