-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SYNBICT: Not Found Error in copy_component_definition #138
Comments
There are a number of places in |
>>> import sbol
>>> doc = sbol.Document()
>>> doc.getComponentDefinition('http://example.com/foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/sbol/libsbol.py", line 15533, in getComponentDefinition
return _libsbol.Document_getComponentDefinition(self, uri)
RuntimeError: Object http://example.com/foo not found This feels like a case of inadvertent API. I doubt anyone thought raising a RuntimeError was a good way to signal that an item was not found. But it has apparently become part of the pySBOL API. We won't be supporting this part of the API going forward. |
This relates to #21 whether we want to be throwing Python Exceptions or our own custom Exceptions. Also the pattern of using a thrown exception to check if an object is contained in the Document is not ideal. Recent versions of pySBOL support use of the |
I have temporarily added a block at the beginning of the file to figure out which type of error to catch: # Set up the not found error for catching
try:
# SBOLError is in the native python module
NotFoundError = SBOLError
except NameError:
# The swig wrapper raises RuntimeError on not found
NotFoundError = RuntimeError And then replace That got me to the next error. |
The fix for this really lies in SYNBICT. See: |
SYNBICT fails with a SBOL
NOT_FOUND_ERROR
in all three unit tests. Two appear to be the same error, one is an error looking for a different object. Here is an example:The text was updated successfully, but these errors were encountered: