11"""
2- Functions to validate Distributed Array Protocol data structures.
2+ Functions to validate Distributed Array Protocol data structures for protocol
3+ version 0.10.0.
34
45Functions
56---------
1213from distutils .version import StrictVersion
1314
1415
16+ VERSIONS = ((0 , 10 , 0 ),)
17+
18+
1519def _verify_exact_keys (dd , keys ):
1620 dkeys = set (dd )
1721 keys = set (keys )
@@ -211,8 +215,6 @@ def validate_dim_dict(idx, dim_dict):
211215 Returns a 2-tuple of a boolean and string; boolean indicates validity, the
212216 string indicates the reason for invalidity, empty otherwise.
213217
214- Currently supports Protocol versions 0.9.x and 1.0.x.
215-
216218 """
217219 # Check for the empty dim_dict alias
218220 if not dim_dict : # the dim_dict is empty
@@ -238,8 +240,6 @@ def validate_dim_data(dim_data):
238240 Returns a 2-tuple of a boolean and string; boolean indicates validity, the
239241 string indicates the reason for invalidity, empty otherwise.
240242
241- Currently supports Protocol versions 0.9.x and 1.0.x.
242-
243243 """
244244 # First, check that it's a tuple...
245245 if not isinstance (dim_data , tuple ):
@@ -268,8 +268,6 @@ def validate(distbuffer):
268268 Returns a 2-tuple of a boolean and string; boolean indicates validity, the
269269 string indicates the reason for invalidity, empty otherwise.
270270
271- Currently supports Protocol versions 0.9.x and 1.0.x.
272-
273271 """
274272 # Verify distbuffer is a dictionary.
275273 if not isinstance (distbuffer , dict ):
@@ -295,7 +293,7 @@ def validate(distbuffer):
295293 return (False , msg % version )
296294
297295 # Verify the version number.
298- if strict_version .version not in (( 0 , 9 , 0 ), ( 1 , 0 , 0 )) :
296+ if strict_version .version not in VERSIONS :
299297 msg = '__version__ "%s" not supported by this checker.'
300298 return (False , msg % version )
301299
0 commit comments