SD2E / opil

The Open Protocol Interface Language (OPIL) is intended as a standard language for protocol interfaces
5 stars 1 forks source link

opil.SampleSet.__init__ does not have same signature as super.__init__ and fails silently #169

Closed bjkeller closed 3 years ago

bjkeller commented 3 years ago

I should be able to give initializer of opil.SampleSet the same arguments as the initializer for sbol3.CombinatorialDerivation, but the arguments are a subset:

>>> import opil
>>> from inspect import signature
>>> signature(opil.SampleSet.__init__)
<Signature (self, identity=None, type_uri='http://bioprotocols.org/opil/v1#SampleSet')>
>>> import sbol3
>>> signature(sbol3.CombinatorialDerivation.__init__)
<Signature (self, identity: str, template: Union[sbol3.component.Component, str], *, type_uri: str = 'http://sbols.org/v3#CombinatorialDerivation') -> None>

And, the only failure happens when you try to use the named arguments. So, opil.SampleSet("identity_string", template, name: 'the name') will fail, but `opil.SampleSet("identity_string", template) does not.