Skip to content

Commit

Permalink
spectra loop update
Browse files Browse the repository at this point in the history
  • Loading branch information
LishaRamon committed Dec 29, 2023
1 parent 5af3823 commit 7e8ed4b
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions scripts/ingests/ingest_bard14_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#Loop through data and update spectra
#def updating_spectra(db):
# for row in bard14_table[0:19]:
#for row in bard14_table[0:19]:

# Print spectra information
# print("Spectra Information:")
Expand All @@ -48,15 +48,21 @@

#Ingest spectra loop 2

def update_all_spectra(db):
#def update_all_spectra(db):
#updating_spectra(db)

with db.engine.begin() as conn:
for entry in update_all_spectra:
source_value = entry['Source']
spectrum_value = entry['Spectrum']
original_spectrum_value = entry['Original Spectrum']
# with db.engine.begin() as conn:
# for entry in update_all_spectra:
# source_value = entry['Source']
# spectrum_value = entry['Spectrum']
# original_spectrum_value = entry['Original Spectrum']

#function to update all spectra in the database
def update_all_spectra(db):
with db.engine.begin() as conn:
for index, row in bard14_table.iterrows():
source_value = row['Source']
spectrum_value = row['Spectrum']
original_spectrum_value = row['Original Spectrum']


#update data in loop
Expand Down

0 comments on commit 7e8ed4b

Please sign in to comment.