Conversation
| group = hf.get(group_name) | ||
| layers: Dict[str, npt.NDArray[numpy.float32]] = {} | ||
| for key, layer in group.items(): | ||
| layers[key] = numpy.array(layer, dtype=numpy.float32) |
There was a problem hiding this comment.
As above, we won't want to convert the masks to floats. I'd just leave them as-is and assume they've been written with the correct dtype.
I think the idiom for this is [:]
layers[key] = layer[:]Also, do we need to create this new dictionary? Can we just work with hf.get(group_name), which is already a dict-like object?
There was a problem hiding this comment.
I checked, when you return group itself it becomes unconnected from the data after the h5py.File object gets closed. So this conversion to Dict of Numpy is needed for later usage.
I would prefer this to be a one-liner in the giant CF/main.py file (btw, I would vote for decomposing it at least into flood and wrf parts). |
No description provided.