SD2E / opil

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

TypeError: __init__() missing 1 required positional argument: 'template' #148

Closed bbartley closed 3 years ago

bbartley commented 3 years ago

See RDF/XML file in https://sd2e.slack.com/archives/C5VKSJVMX/p1611962589148500

bjkeller commented 3 years ago

@bbartley Not sure if this is replicating, but this should be a minimal version of the code that generated that example. The reported error was in an older version of opil.

Note this is only using sbol3

import sbol3
from tyto import SBO

sbol3.set_homespace('http://aquarium.bio')
doc = sbol3.Document()

template = sbol3.Component('design', SBO.functional_entity)
doc.add(template)

sample_space = sbol3.CombinatorialDerivation(
    'conditions',
    template,
    type_uri='http://bbn.com/synbio/opil#SampleSet'
)
sample_space.name = "HTC culture condition design"

# This is present in the code with the failure
# sample_space.variable_components = variable_components

doc.add(sample_space)

# leaving out the rest of the protocol interface

doc.write('example_sample_set.xml', file_format='xml')
bjkeller commented 3 years ago

Here's what I get with sbol3 1.0a6

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:sbol="http://sbols.org/v3#"
>
  <rdf:Description rdf:about="http://aquarium.bio/design">
    <sbol:displayId>design</sbol:displayId>
    <rdf:type rdf:resource="http://sbols.org/v3#Component"/>
    <sbol:type rdf:resource="https://identifiers.org/SBO:0000241"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://aquarium.bio/conditions">
    <sbol:displayId>conditions</sbol:displayId>
    <sbol:name>HTC culture condition design</sbol:name>
    <rdf:type rdf:resource="http://bbn.com/synbio/opil#SampleSet"/>
    <sbol:template rdf:resource="http://aquarium.bio/design"/>
  </rdf:Description>
</rdf:RDF>
bbartley commented 3 years ago

149 provides a hard-coded kludge solution. This is a temporary workaround for a stickier problem that may require deeper refactoring and harmonization between pySBOL3 and opil. See https://github.com/SynBioDex/pySBOL3/issues/182.

Thanks to @bjkeller for the minimal reproducible example.