@@ -76,7 +76,7 @@ def db_from_owl(input: str) -> str:
7676 make (db )
7777 return db
7878 else :
79- raise ValueError (f "Path must be an OWL file" )
79+ raise ValueError ("Path must be an OWL file" )
8080
8181
8282def download_obo_sqlite (ontology : str , destination : str ):
@@ -108,8 +108,7 @@ def connect(owl_file: str):
108108 """
109109 db = db_from_owl (owl_file )
110110 engine = create_engine (f"sqlite:///{ db } " )
111- Session = sessionmaker (bind = engine )
112- session = Session ()
111+ session = sessionmaker (bind = engine )()
113112 return session
114113
115114
@@ -133,16 +132,18 @@ def compile_registry(registry_path: str, local_prefix_file: TextIO = None) -> st
133132 if ont == generic :
134133 command = "curl -L -s http://purl.obolibrary.org/obo/$*.owl > $@.tmp"
135134 elif ont .zip_extract_file :
136- command = f"curl -L -s { ont .url } > $@.zip.tmp && unzip -p $@.zip.tmp { ont .zip_extract_file } > $@.tmp && rm $@.zip.tmp"
135+ command = (f"curl -L -s { ont .url } > $@.zip.tmp && "
136+ "unzip -p $@.zip.tmp {ont.zip_extract_file} "
137+ "> $@.tmp && rm $@.zip.tmp" )
137138 else :
138139 command = f"curl -L -s { ont .url } > $@.tmp"
139140 download_rule = MakefileRule (
140141 target = f"download/{ ont .id } .owl" ,
141142 dependencies = ["STAMP" ],
142143 commands = [
143144 command ,
144- f "sha256sum -b $@.tmp > $@.sha256" ,
145- f "mv $@.tmp $@" ,
145+ "sha256sum -b $@.tmp > $@.sha256" ,
146+ "mv $@.tmp $@" ,
146147 ],
147148 precious = True ,
148149 )
@@ -151,11 +152,11 @@ def compile_registry(registry_path: str, local_prefix_file: TextIO = None) -> st
151152 target = f"db/{ ont .id } .owl"
152153 dependencies = [f"download/{ ont .id } .owl" ]
153154 if ont .has_imports or (ont .format and ont .format != "rdfxml" ):
154- command = f "robot merge -i $< -o $@"
155+ command = "robot merge -i $< -o $@"
155156 elif ont .build_command :
156157 command = ont .build_command .format (ont = ont )
157158 else :
158- command = f "cp $< $@"
159+ command = "cp $< $@"
159160 rule = MakefileRule (
160161 target = target , dependencies = dependencies , commands = [command ]
161162 )
0 commit comments