Skip to content

Commit

Permalink
padding warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gwbischof committed Oct 25, 2024
1 parent eeeb9ab commit bb4b68c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion databroker/mongo_normalized.py
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,7 @@ def default_validate_shape(key, data, expected_shape):
* If number of dimensions differ, raise BadShapeMetadata
* If any dimension differs by more than MAX_SIZE_DIFF, raise BadShapeMetadata.
* If some dimensions are smaller than expected,, pad "right" edge of each
dimension that falls short with NaN.
dimension that falls short with zeros..
"""
MAX_SIZE_DIFF = 2
if data.shape == expected_shape:
Expand Down Expand Up @@ -2242,6 +2242,11 @@ def default_validate_shape(key, data, expected_shape):
else: # margin == 0
padding.append((0, 0))
padded = numpy.pad(data, padding, "edge")

logger.warning(f"The data.shape: {data.shape} did not match the expected_shape: "
f"{expected_shape} for key: '{key}'. This data has been zero-padded "
"to match the expected shape!")

return padded


Expand Down

0 comments on commit bb4b68c

Please sign in to comment.