Skip to content

Commit 030e251

Browse files
committed
change handling of h5py compatibility
1 parent 5b88b6c commit 030e251

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

zarr/hierarchy.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import, print_function, division
33
from collections import Mapping
4+
from warnings import warn
45

56

67
import numpy as np
@@ -505,8 +506,16 @@ def create_dataset(self, name, data=None, shape=None, chunks=None,
505506
if contains_group(self.store, path):
506507
raise KeyError(name)
507508

508-
# compatibility with h5py
509-
fill_value = kwargs.get('fillvalue', fill_value)
509+
# N.B., additional kwargs are included in method signature to
510+
# improve compatibility for users familiar with h5py and adapting
511+
# code that previously used h5py. These keyword arguments are
512+
# ignored here but we raise a warning to let the user know.
513+
for k in kwargs:
514+
if k == 'fillvalue':
515+
warn("ignoring keyword argument %r; please use 'fill_value' "
516+
"instead" % k)
517+
else:
518+
warn('ignoring keyword argument %r' % k)
510519

511520
if data is not None:
512521
a = array(data, chunks=chunks, dtype=dtype,

0 commit comments

Comments
 (0)