From c66b848a22ae4daa1bfef042ea39aa0434e1297c Mon Sep 17 00:00:00 2001 From: David Rodriguez Date: Tue, 30 Apr 2024 16:43:28 -0400 Subject: [PATCH] Updating column name to access_url --- simple_app/plots.py | 4 ++-- simple_app/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simple_app/plots.py b/simple_app/plots.py index f9b31f0..1c302a6 100644 --- a/simple_app/plots.py +++ b/simple_app/plots.py @@ -132,7 +132,7 @@ def normalise() -> np.ndarray: db = SimpleDB(db_file) # open database t_spectra: Table = db.query(db.Spectra).\ filter(db.Spectra.c.source == query).\ - table(spectra=['spectrum']) + table(spectra=['access_url']) # initialise plot n_fail, fail_string_list = 0, [] @@ -153,7 +153,7 @@ def normalise() -> np.ndarray: # checking each spectra in table for spec in t_spectra: - spectrum: Spectrum1D = spec['spectrum'] + spectrum: Spectrum1D = spec['access_url'] # checking spectrum has good units and not only NaNs try: diff --git a/simple_app/utils.py b/simple_app/utils.py index 0de5f76..44237e3 100644 --- a/simple_app/utils.py +++ b/simple_app/utils.py @@ -104,7 +104,7 @@ def spectra_handle(df: pd.DataFrame, drop_source: bool = True): # convert links to spectra files from plaintext to hyperlinks url_links = [] - for source in df.spectrum.values: + for source in df.access_url.values: source_link = f'Link' url_links.append(source_link) @@ -112,7 +112,7 @@ def spectra_handle(df: pd.DataFrame, drop_source: bool = True): df.drop(columns=[col for col in df.columns if any([sub_string in col for sub_string in ('wave', 'flux', 'original')])], inplace=True) - drop_cols = ['spectrum', 'local_spectrum', 'regime'] + drop_cols = ['access_url', 'local_spectrum', 'regime'] if drop_source: drop_cols.append('source') df.drop(columns=drop_cols, inplace=True, errors='ignore')