From e86aed9da386b8773c41282cbaca0117a919bb5c Mon Sep 17 00:00:00 2001 From: Steph Merritt Date: Tue, 5 Nov 2024 11:53:43 +0000 Subject: [PATCH] Moving database, fixing bug. --- src/adler/adler_day.py | 7 +++++-- .../data/adler-day-testing.db | Bin 2 files changed, 5 insertions(+), 2 deletions(-) rename adler-day-testing.db => tests/data/adler-day-testing.db (100%) diff --git a/src/adler/adler_day.py b/src/adler/adler_day.py index 3a561e0..2a5ae3b 100644 --- a/src/adler/adler_day.py +++ b/src/adler/adler_day.py @@ -1,5 +1,6 @@ from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid from adler.science.PhaseCurve import PhaseCurve +import os import pandas as pd import astropy.units as u import numpy as np @@ -24,10 +25,12 @@ def run_adler_day(ssobject_list): planetoid = AdlerPlanetoid.construct_from_cassandra(ssoid, date_range=[60290.0, 61902]) try: - planetoid.attach_previous_adler_data("adler-day-testing.db") + dirname = os.path.dirname(__file__) + database_path = os.path.join(dirname, "../../tests/data/adler-day-testing.db") + planetoid.attach_previous_adler_data(database_path) previousAdlerData = True # this could be a flag on the AdlerPlanetoid object except ValueError: - # no AdlerData for this object ID as yet + print("No data found for this object in AdlerDatabase.") previousAdlerData = False for filt in planetoid.filter_list: diff --git a/adler-day-testing.db b/tests/data/adler-day-testing.db similarity index 100% rename from adler-day-testing.db rename to tests/data/adler-day-testing.db