Skip to content

Commit

Permalink
update generate_inserts
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroMTQ committed Apr 16, 2022
1 parent cc202df commit cc645be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions mantis/Metadata_SQLITE_Connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,10 @@ def generate_inserts(self, metadata_yielder):
step=self.insert_step
temp=[]
for i in metadata_yielder:
if len(temp)<step:
temp.append(i)
else:
temp.append(i)
if len(temp)>=step:
yield temp
temp=[]
temp.append(i)
yield temp

def store_metadata(self):
Expand Down
5 changes: 2 additions & 3 deletions mantis/Taxonomy_SQLITE_Connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ def generate_inserts(self, input_generator):
step=self.insert_step
temp=[]
for i in input_generator:
if len(temp)<step:
temp.append(i)
elif len(temp)==step:
temp.append(i)
if len(temp)>=step:
yield temp
temp=[]
yield temp
Expand Down

0 comments on commit cc645be

Please sign in to comment.