Skip to content

Commit

Permalink
feat(memh5): add warning when trying to make shallow/shared copy to file
Browse files Browse the repository at this point in the history
  • Loading branch information
ljgray committed Jul 29, 2024
1 parent d10fdce commit b7bc6e3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions caput/memh5.py
Original file line number Diff line number Diff line change
Expand Up @@ -2701,8 +2701,20 @@ def _prepare_compression_args(dset):
# If copying to file, datasets are not shared, so ensure that these
# datasets are properly processed
if to_file:
shared = {}
shallow = False
if shared:
warnings.warn(
f"Attempted to share datasets {(*shared,)}, but target group "
f"{g2} is on disk. Datasets cannot be shared."
)
shared = {}

if shallow:
warnings.warn(
f"Attempted to make a shallow copy of group {g1}, but target "
f"group {g2} is on disk. Datasets cannot be shared."
)
shallow = False

elif not shallow:
# Make sure shared dataset names are properly formatted
shared = {"/" + k if k[0] != "/" else k for k in shared}
Expand Down

0 comments on commit b7bc6e3

Please sign in to comment.