Skip to content
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

AttributeError: function 'c_api_isSetGeometricShapeBorderColor' not found #9

Open
dalbabur opened this issue Nov 16, 2024 · 1 comment

Comments

@dalbabur
Copy link

Getting this error when calling draw(). full trace below

this is sbmlnetwork 0.4.0 on Windows

{
	"name": "AttributeError",
	"message": "function 'c_api_isSetGeometricShapeBorderColor' not found",
	"stack": "---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[31], line 1
----> 1 M0.draw()

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\\sbmlnetwork\\sbmlnetwork.py:24, in SBMLNetwork.draw(self, file_name)
     19     networkinfotranslator.import_sbml_export_figure(self.save(), file_name, self.use_name_as_text_label,
     20                                                     self.display_compartments_text_label,
     21                                                     self.display_species_text_label,
     22                                                     self.display_reactions_text_label)
     23 else:
---> 24     display(networkinfotranslator.import_sbml_export_pil_image(self.save(), self.use_name_as_text_label,
     25                                                                self.display_compartments_text_label,
     26                                                                self.display_species_text_label,
     27                                                                self.display_reactions_text_label))

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\
etwork_info_translator.py:25, in import_sbml_export_pil_image(import_file, use_name_as_text_label, display_compartments_text_label, display_species_text_label, display_reactions_text_label)
     23 import_from_sbml.extract_info(import_file)
     24 export_to_figure = NetworkInfoExportToSkia()
---> 25 export_to_figure.extract_graph_info(import_from_sbml)
     26 return export_to_figure.export_as_pil_image()

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\\exports\\export_base.py:14, in NetworkInfoExportBase.extract_graph_info(self, graph_info)
     11 self.graph_info = graph_info
     13 # update the features of the entities
---> 14 graph_info.extract_entity_features()
     16 # background canvas
     17 self.set_background(graph_info)

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\\imports\\import_base.py:111, in NetworkInfoImportBase.extract_entity_features(self)
    108 def extract_entity_features(self):
    109     # compartments
    110     for compartment in self.compartments:
--> 111         self.extract_compartment_features(compartment)
    113     # species
    114     for species in self.species:

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\\imports\\import_sbml.py:135, in NetworkInfoImportFromSBMLModel.extract_compartment_features(self, compartment)
    133 def extract_compartment_features(self, compartment):
    134     if compartment['referenceId']:
--> 135         compartment['features'] = self.extract_go_general_features(compartment['referenceId'], compartment['index'])
    136         if self.display_compartments_text_label:
    137             compartment['texts'] = self.extract_go_text_features(compartment['referenceId'], compartment['index'])

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\\imports\\import_sbml.py:326, in NetworkInfoImportFromSBMLModel.extract_go_general_features(self, entity_id, graphical_object_index)
    324 def extract_go_general_features(self, entity_id, graphical_object_index):
    325     features = {'boundingBox': self.extract_bounding_box_features(entity_id, graphical_object_index),
--> 326                 'graphicalShape': self.extract_graphical_shape_features(entity_id, graphical_object_index)}
    328     return features

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\\imports\\import_sbml.py:343, in NetworkInfoImportFromSBMLModel.extract_graphical_shape_features(self, entity_id, graphical_object_index)
    341 graphical_shape_info = {}
    342 graphical_shape_info = self.extract_render_group_general_features(entity_id, graphical_object_index)
--> 343 graphical_shape_info['geometricShapes'] = self.extract_render_group_geometric_shapes(entity_id, graphical_object_index)
    345 return graphical_shape_info

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\\imports\\import_sbml.py:404, in NetworkInfoImportFromSBMLModel.extract_render_group_geometric_shapes(self, entity_id, graphical_object_index)
    402 for gs_index in range(self.sbml_network.getNumGeometricShapes(entity_id, graphical_object_index)):
    403     geometric_shape = {}
--> 404     geometric_shape.update(self.extract_geometric_shape_general_features(entity_id, graphical_object_index, gs_index))
    405     geometric_shape.update(self.extract_geometric_shape_exclusive_features(entity_id, graphical_object_index, gs_index))
    406     geometric_shapes.append(geometric_shape)

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\
etworkinfotranslator\\imports\\import_sbml.py:423, in NetworkInfoImportFromSBMLModel.extract_geometric_shape_general_features(self, entity_id, graphical_object_index, geometric_shape_index)
    421 geometric_shape_general_features = {}
    422 # get stroke color
--> 423 if self.sbml_network.isSetGeometricShapeBorderColor(entity_id, geometric_shape_index, graphical_object_index):
    424     geometric_shape_general_features['strokeColor'] = self.sbml_network.getGeometricShapeBorderColor(entity_id,
    425                                                                                                      geometric_shape_index,
    426                                                                                                      graphical_object_index)
    428 # get stroke width

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\site-packages\\libsbmlnetwork\\libsbmlnetwork.py:9428, in LibSBMLNetwork.isSetGeometricShapeBorderColor(self, id, geometric_shape_index, graphical_object_index, layout_index)
   9413 def isSetGeometricShapeBorderColor(self, id, geometric_shape_index=0, graphical_object_index=0, layout_index=0):
   9414     \"\"\"
   9415     Returns whether the border color of the GeometricShape object with the given index associated with the model entity with the given id in the given SBMLDocument is set
   9416 
   (...)
   9426         true if the border color of the GeometricShape object with the given index associated with the model entity with the given id in the given SBMLDocument is set and false otherwise
   9427     \"\"\"
-> 9428     return lib.c_api_isSetGeometricShapeBorderColor(self.sbml_object, str(id).encode(), geometric_shape_index, graphical_object_index, layout_index)

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\ctypes\\__init__.py:387, in CDLL.__getattr__(self, name)
    385 if name.startswith('__') and name.endswith('__'):
    386     raise AttributeError(name)
--> 387 func = self.__getitem__(name)
    388 setattr(self, name, func)
    389 return func

File c:\\Users\\Diego Alba\\.conda\\envs\\ODBM2\\lib\\ctypes\\__init__.py:392, in CDLL.__getitem__(self, name_or_ordinal)
    391 def __getitem__(self, name_or_ordinal):
--> 392     func = self._FuncPtr((name_or_ordinal, self))
    393     if not isinstance(name_or_ordinal, int):
    394         func.__name__ = name_or_ordinal

AttributeError: function 'c_api_isSetGeometricShapeBorderColor' not found"
}
@adelhpour
Copy link
Member

@dalbabur Thanks for reporting this! Could you share the script or steps you used to reproduce the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants