File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 185185 "end_date" : " 2026-04-14" ,
186186 "description" : " Spectra provided by BONES Archive"
187187 },
188+ {
189+ "version" : " 5.4.2026.02" ,
190+ "start_date" : " 2026-04-14" ,
191+ "end_date" : " 2026-04-14" ,
192+ "description" : " Add database.toml"
193+ },
188194 {
189195 "version" : " latest" ,
190196 "start_date" : " 2026-04-14" ,
Original file line number Diff line number Diff line change 1+ db_name = " simple_tests"
2+ data_path = " data/"
3+ felis_path = " schema.yaml"
14
2- REFERENCE_TABLES = [
5+ lookup_tables = [
36 " Publications" ,
47 " Telescopes" ,
58 " Instruments" ,
9+ " Parameters" ,
610 " PhotometryFilters" ,
711 " Versions" ,
8- "Parameters" ,
912 " RegimeList" ,
10- "CompanionList"
11- ]
13+ " CompanionList" ,
14+ ]
File renamed without changes.
Original file line number Diff line number Diff line change 33import sys
44
55import pytest
6- from astrodb_utils import load_astrodb
6+ from astrodb_utils . loaders import build_db_from_json , DatabaseSettings
77from astrodbkit .astrodb import Database , create_database
88
99sys .path .append ("./" ) # needed for github actions to find the simple module
10- from simple import REFERENCE_TABLES
1110
1211logger = logging .getLogger ("AstroDB" )
1312
14- SCHEMA_PATH = "simple/schema.yaml"
15-
13+ db_settings = DatabaseSettings ( settings_file = "database.toml" )
14+ SCHEMA_PATH = db_settings . felis_path
1615
1716# Create a fresh SIMPLE database for the data and integrity tests
1817@pytest .fixture (scope = "session" , autouse = True )
1918def db ():
20- DB_NAME = "tests/simple_tests.sqlite"
21- DB_PATH = "data"
22-
23- if os .path .exists (DB_NAME ):
24- os .remove (DB_NAME )
25- connection_string = "sqlite:///" + DB_NAME
26- create_database (connection_string , felis_schema = SCHEMA_PATH )
27- assert os .path .exists (DB_NAME )
28-
29- # Connect to the new database
30- db = load_astrodb (DB_NAME ,
31- data_path = DB_PATH ,
32- reference_tables = REFERENCE_TABLES ,
33- felis_schema = SCHEMA_PATH )
19+ db = build_db_from_json (
20+ settings_file = "database.toml"
21+ )
3422
3523 return db
3624
Original file line number Diff line number Diff line change 22
33import yaml
44from pydantic import ValidationError
5-
5+ from astrodb_utils . loaders import DatabaseSettings
66from felis .datamodel import Schema
77
8- SCHEMA_PATH = "simple/schema.yaml"
9-
8+ db_settings = DatabaseSettings ( settings_file = "database.toml" )
9+ SCHEMA_PATH = db_settings . felis_path
1010
1111def test_schema ():
1212 data = yaml .safe_load (open (SCHEMA_PATH , "r" ))
You can’t perform that action at this time.
0 commit comments