@@ -111,13 +111,16 @@ def search_models(self, search):
111
111
# print(len(data))
112
112
return search_results
113
113
114
- def get_model (self , model_id ):
114
+ def get_model (self , model_id ): # TODO: need to fix, model id does not correlate to model file name
115
115
"""Return the model data for the given model ID."""
116
- user = "konankisa "
116
+ user = "sys-bio "
117
117
repo = "BiomodelsStore"
118
118
repo = Github ().get_user (user ).get_repo (repo )
119
+ print ("Repository name: " ,repo .name )
119
120
try :
120
- content = repo .get_contents (f"biomodels/{ model_id } .xml" )
121
+ #content2 = repo.get_contents(f"biomodels/{model_id}")
122
+ #print(content2.pop(0))
123
+ content = repo .get_contents (f"biomodels/{ model_id } /{ model_id } _url.xml" )
121
124
except :
122
125
content = None
123
126
if content :
@@ -128,11 +131,11 @@ def get_model(self, model_id):
128
131
129
132
def main ():
130
133
cache = BioModelsCache ()
131
- # cache.cache_biomodels() # Update/build BioModelsCache
134
+ cache .cache_biomodels () # Update/build BioModelsCache
132
135
print ("Test cache.searchmodels()..." )
133
- cache .search_models ("BIOMD0000000002" ) # Check search()
136
+ print ( cache .search_models ("sodium" )) # Check search(), returns multiple model ids
134
137
print ("Test cache.get_model()......" )
135
- cache .get_model ("BIOMD0000000003 " ) # Check get_model()
138
+ cache .get_model ("BIOMD0000000002 " ) # Check get_model()
136
139
137
140
if __name__ == '__main__' :
138
141
main ()
0 commit comments