-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Currently we use required_capabilities to list all the capabilities that are required for a particular test to be undertaken on a given model. I was wondering if there is a way (and if not, if it would be useful to implement) a method to allow specification of one or more sets of capabilities, such that each set individually suffices for the test to be undertaken by the model.
As a potential example, something like:
self.required_capabilities = [(cap_A, cap_B), (cap_C) ]
Here the model should either implement cap_A AND cap_B, or just cap_C.
Either of these sets of capabilties would suffice for the test.
To get into some more detail...
I would normally split the capabilities into more elemental units, such that a seemingly composite capability such as cap_C isn't created. But in my current use case, I am creating a model loader for models output via BluePyOpt (BPO)(https://github.com/BlueBrain/BluePyOpt). As we have a number of teams developing models using this package, and the output being produced in a standardized format, we were keen to allow several of our tests to be easily undertaken on these models.
For this purpose we created a model loader class in Python, that took as input the path to the zip file generated by BPO, and the class would unzip and implement all the required capabilities for these model, and return a sciunit.Model object as output. Currently, I inherit this model loader class individually from all the individual capabilities that I desire to have implemented.
I was wondering if I could maybe create a new capability, such as a capability named BPO_compatible in our base validation package, and then any test module (other packages such as 'hippounit') could specify required_capabilities for their tests as:
self.required_capabilities = [(cap_A, cap_B), (BPO_compatible) ]
whereby the BPO model loader class will simply inherit from BPO_compatible (defined in our base validation module), and non-BPO models will require to implement cap_A AND cap_B (which would be more elemental capabilities defined in the test module). Effectively, BPO_compatible will eventually be a large composite compatibility that allows BPO models to implictly implement various capabilities, and thereby undertake several validation tests 'out of the box'.
So in summary:
BPO_compatiblewould be large composite capabilityBPO_compatiblewould be defined and implemented within our base validation module, (while other elemental capabilities would be defined within their test modules)
To some extent, I am thinking out loud here, and so might have missed a few details.
@rgerkin : not sure if there is already a method to implement this?