Skip to content

Updates to website issue#211

Merged
dr-rodriguez merged 16 commits intoSIMPLE-AstroDB:mainfrom
Will-Cooper:updates
Apr 30, 2026
Merged

Updates to website issue#211
dr-rodriguez merged 16 commits intoSIMPLE-AstroDB:mainfrom
Will-Cooper:updates

Conversation

@Will-Cooper
Copy link
Copy Markdown
Member

Looking across several issues, updating versions and some documentation.
Should also close #180 with some logic changes, since underlying package updates.
Makes sqllite file downloadable, adds a link to the json.
Spectra also now downloadable from raw query.

Closes SIMPLE-AstroDB#189, moving reference tables
Closes SIMPLE-AstroDB#207, closes SIMPLE-AstroDB#208, closes SIMPLE-AstroDB#209 -- updating some packages,
including matching js static libs.
SQL query.
Improves functionality for handling references coming out of sql_query
with different dimensions.
@Will-Cooper Will-Cooper self-assigned this Apr 8, 2026
@Will-Cooper Will-Cooper added bug Something isn't working documentation Improvements or additions to documentation labels Apr 8, 2026
@kelle
Copy link
Copy Markdown
Contributor

kelle commented Apr 13, 2026

This looks like progress -- great work! But I think review should really come from @dr-rodriguez .

Please keep in mind that SIMPLE should be using a database.toml file which specifies the reference tables. It's not doing that yet, but will be in the next month or so. (@ying2212 is working on it.)

Reference issue: SIMPLE-AstroDB/SIMPLE-db#672

Copy link
Copy Markdown
Collaborator

@dr-rodriguez dr-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are 4 functions added in utils.py, which has a test module. We should add tests for these 4 functions, particularly since they focus mainly on manipulating strings.

Comment thread simple_app/simports.py Outdated
from tqdm import tqdm # progress bars
from werkzeug.exceptions import HTTPException # underlying http
from wtforms import StringField, SubmitField, TextAreaField, ValidationError # web forms
from simple import REFERENCE_TABLES
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break with the recent changes because the init file has been removed in favor of a database.toml file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this instead to:

import tomllib
with open("database.toml", "rb") as f:
    settings = tomllib.load(f)
    REFERENCE_TABLES = settings['lookup_tables']

Comment thread requirements.txt Outdated
Werkzeug==3.1.4
Werkzeug==3.1.5
WTForms==3.2.1
simple @ git+https://github.com/SIMPLE-AstroDB/SIMPLE-db No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of importing simple, we want to update the cronjob so that it pulls the database.toml from from github and then imports it:

from astrodb_utils.loaders import DatabaseSettings
db_settings=DatabaseSettings(settings_file="database.toml")
REFERENCE_TABLES = db_settings.lookup_tables

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to use astrodb_utils- it requires too much of the setup and fails if we only have the database.toml file. Instead we'll use the built-in library tomlib

@dr-rodriguez
Copy link
Copy Markdown
Collaborator

The cronjob.sh needs to read:

cd ~/ROOT
wget -O SIMPLE.sqlite https://raw.githubusercontent.com/SIMPLE-AstroDB/SIMPLE-binary/main/SIMPLE.sqlite
wget https://raw.githubusercontent.com/SIMPLE-AstroDB/SIMPLE-db/refs/heads/main/database.toml
git pull

I recommend including this in this PR as per #212

@dr-rodriguez
Copy link
Copy Markdown
Collaborator

I tested this in a codespace but don't have permissions to push to this branch, let us know how you want to proceed with these @Will-Cooper

@Will-Cooper
Copy link
Copy Markdown
Member Author

I've made the cronjob changes and included it in git. Database.toml wasn't as clear, as we also need a data folder as well as schema.yaml in the same directory too - I've included some logic to do so

@dr-rodriguez
Copy link
Copy Markdown
Collaborator

I've made the cronjob changes and included it in git. Database.toml wasn't as clear, as we also need a data folder as well as schema.yaml in the same directory too - I've included some logic to do so

We ran into this issue while testing and opted instead to use tomlib:

import tomllib
with open("database.toml", "rb") as f:
    settings = tomllib.load(f)
    REFERENCE_TABLES = settings['lookup_tables']

This uses the database.toml file without the extra requirements of the data folder or schema file.

@dr-rodriguez
Copy link
Copy Markdown
Collaborator

Merge Will-Cooper#9 first

Cleaner implementation of toml read
@Will-Cooper
Copy link
Copy Markdown
Member Author

Merge Will-Cooper#9 first

Thanks for doing that, sorry I didn't get around to it!

Removed the download of schema.yaml from the workflow.
Comment thread simple_app/simports.py Outdated
from tqdm import tqdm # progress bars
from werkzeug.exceptions import HTTPException # underlying http
from wtforms import StringField, SubmitField, TextAreaField, ValidationError # web forms
from simple import REFERENCE_TABLES
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this instead to:

import tomllib
with open("database.toml", "rb") as f:
    settings = tomllib.load(f)
    REFERENCE_TABLES = settings['lookup_tables']

Comment thread requirements.txt Outdated
Werkzeug==3.1.4
Werkzeug==3.1.5
WTForms==3.2.1
simple @ git+https://github.com/SIMPLE-AstroDB/SIMPLE-db No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to use astrodb_utils- it requires too much of the setup and fails if we only have the database.toml file. Instead we'll use the built-in library tomlib

@dr-rodriguez dr-rodriguez merged commit 751e9de into SIMPLE-AstroDB:main Apr 30, 2026
1 check passed
@Will-Cooper Will-Cooper deleted the updates branch April 30, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raw SQL Query Not Working

3 participants