diff --git a/.release b/.release index 79932ec25b045f4fa1a26bb7d214c401ff78790e..d0f247ddee30ef3cb1266b9f7e23643c622d7902 100644 --- a/.release +++ b/.release @@ -1,2 +1,2 @@ -release=0.10.0 -tag=ska_tango_base-0.10.0 +release=0.10.1 +tag=ska_tango_base-0.10.1 diff --git a/README.md b/README.md index 4cfacfbfd9541e3a8160c86146b771381e7d1ab4..35836788cac3e18291b4381762c2fa9e602befdc 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,10 @@ The ska-tango-base repository includes a set of eight classes as mentioned in SK ## Version History -#### Not released yet +#### 0.10.1 - Make dependency on `pytango` and `numpy` python packages explicit. +- Add optional "key" parameter to `SKASubarrayResourceManager` to filter JSON for + assign & release methods. #### 0.10.0 - Add `DebugDevice` command to `SKABaseDevice`. This allows remote debugging to be diff --git a/src/ska_tango_base/release.py b/src/ska_tango_base/release.py index 6e60c36d97062f11c2303d32e4d1f2b65093a31e..8b8714e48dde3db439881c484a47a372068ea95e 100644 --- a/src/ska_tango_base/release.py +++ b/src/ska_tango_base/release.py @@ -7,7 +7,7 @@ """Release information for ska_tango_base Python Package""" name = """ska_tango_base""" -version = "0.10.0" +version = "0.10.1" version_info = version.split(".") description = """A set of generic base devices for SKA Telescope.""" author = "SKA India and SARAO and CSIRO and INAF" diff --git a/src/ska_tango_base/subarray_device.py b/src/ska_tango_base/subarray_device.py index 1108c65370c0fa6ba6f6c472d5cd1d8b556ccab8..044bdd1d4022fcb0ddc02f46eb7ca3c24ef868ac 100644 --- a/src/ska_tango_base/subarray_device.py +++ b/src/ska_tango_base/subarray_device.py @@ -114,11 +114,14 @@ class SKASubarrayResourceManager: A simple class for managing subarray resources """ - def __init__(self): + def __init__(self, key: str = "example"): """ Constructor for SKASubarrayResourceManager + + :param key: Key used to select from JSON input to assign/release methods. """ self._resources = set() + self._key = key def __len__(self): """ @@ -136,15 +139,15 @@ class SKASubarrayResourceManager: Assign some resources :todo: Currently implemented for testing purposes to take a JSON - string encoding a dictionary with key 'example'. In future this + string encoding a dictionary. In future this will take a collection of resources. :param resources: JSON-encoding of a dictionary, with resources to - assign under key 'example' + assign under the configured key (default 'example') :type resources: JSON string """ resources_dict = json.loads(resources) - add_resources = resources_dict['example'] + add_resources = resources_dict[self._key] self._resources |= set(add_resources) def release(self, resources): @@ -152,15 +155,15 @@ class SKASubarrayResourceManager: Release some resources :todo: Currently implemented for testing purposes to take a JSON - string encoding a dictionary with key 'example'. In future this + string encoding a dictionary. In future this will take a collection of resources. :param resources: JSON-encoding of a dictionary, with resources to - assign under key 'example' + assign under the configured key (default 'example') :type resources: JSON string """ resources_dict = json.loads(resources) - drop_resources = resources_dict['example'] + drop_resources = resources_dict[self._key] self._resources -= set(drop_resources) def release_all(self):