Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
xnought committed Nov 17, 2023
1 parent 569caaa commit 86ae085
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions backend/src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ def get_all_entries():
"""
with Database() as db:
try:
entries_sql = db.execute_return("""SELECT id, name, filePDBAlphaFold, length, mass FROM proteins""")
entries_sql = db.execute_return(
"""SELECT id, name, filePDBAlphaFold, length, mass FROM proteins"""
)
log.warn(entries_sql)

# if we got a result back
if entries_sql is not None:
return [
ProteinEntry(id=str(entry[0]), name=entry[1], filePDBAlphaFold=entry[2], length=entry[3], mass=entry[4])
ProteinEntry(
id=str(entry[0]),
name=entry[1],
filePDBAlphaFold=entry[2],
length=entry[3],
mass=entry[4],
)
for entry in entries_sql
]
except Exception as e:
Expand All @@ -46,7 +54,13 @@ def get_protein_entry(protein_id: str):
# if we got a result back
if entry_sql is not None and len(entry_sql) != 0:
# return the only entry
return ProteinEntry(id=str(entry_sql[0][0]), name=entry_sql[0][1], filePDBAlphaFold=entry_sql[0][2], length=entry_sql[0][3], mass=entry_sql[0][4])
return ProteinEntry(
id=str(entry_sql[0][0]),
name=entry_sql[0][1],
filePDBAlphaFold=entry_sql[0][2],
length=entry_sql[0][3],
mass=entry_sql[0][4],
)

except Exception as e:
log.error(e)
Expand Down

0 comments on commit 86ae085

Please sign in to comment.