Skip to content

Commit 821ae80

Browse files
committed
movement
1 parent c9bd993 commit 821ae80

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

lib/bald/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
from bald.validation import ContainerValidation, DatasetValidation
88

99

10-
class HttpStatusCache(object):
10+
class HttpCache(object):
11+
"""
12+
Requests cache.
13+
"""
1114
def __init__(self):
1215
self.cache = {}
1316

@@ -31,6 +34,8 @@ def check_uri(self, uri):
3134
class Subject(object):
3235
def __init__(self, attrs=None):
3336
"""
37+
A subject of metadata statements.
38+
3439
attrs: an dictionary of key value pair attributes
3540
"""
3641
if attrs is None:

lib/bald/tests/integration/test_validation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def test_mismatch_pdisjc_lead_dim(self):
8888
f = _fattrs(f)
8989
# child and parent have disjoint leading dimensions
9090
f = _create_parent_child(f, (4, 13, 17), (7, 13, 17))
91+
9192
f.close()
9293
self.assertFalse(bald.validate_hdf5(tfile))
9394

lib/bald/validation.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import bald
66

77

8-
def valid_array_reference(parray, carray):
8+
def valid_array_reference(parray, carray, broadcast_shape=None):
99
"""
1010
Returns boolean.
1111
Validates bald array broadcasting rules between a parent array and a child array.
@@ -14,6 +14,10 @@ def valid_array_reference(parray, carray):
1414
* parray - a numpy array: the parent of a bald array reference relation
1515
1616
* carray - a numpy array: the child of a bald array reference relation
17+
18+
* broadcast_shape - a string defining the ordered list of dimensions and sizes
19+
for the resulting array from broadcasting parry and carray;
20+
e.g. (1,1,
1721
"""
1822
# https://github.com/SciTools/courses/blob/master/course_content/notebooks/numpy_intro.ipynb
1923
# https://cs231n.github.io/python-numpy-tutorial/#numpy-broadcasting
@@ -44,10 +48,10 @@ class SubjectValidation(Validation):
4448
def __init__(self, subject, fhandle, httpcache=None):
4549
self.subject = subject
4650
self.fhandle = fhandle
47-
if isinstance(httpcache, bald.HttpStatusCache):
51+
if isinstance(httpcache, bald.HttpCache):
4852
self.cache = httpcache
4953
else:
50-
self.cache = bald.HttpStatusCache()
54+
self.cache = bald.HttpCache()
5155

5256

5357
def is_valid(self):

0 commit comments

Comments
 (0)