Skip to content

Commit

Permalink
Create alias for save method (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-rodriguez authored Feb 16, 2025
1 parent 0112ab7 commit 24a4749
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion astrodbkit/astrodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ def __init__(
connection_string, sqlite_foreign=sqlite_foreign, connection_arguments=connection_arguments
)

# Convenience methods
# Convenience methods and aliases
self.query = self.session.query
self.save = self.save_database
self.save_db = self.save_database
self.load_db = self.load_database

Expand Down
3 changes: 2 additions & 1 deletion astrodbkit/tests/test_astrodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ def test_save_database(db, db_dir):
elif os.path.isdir(file_path):
shutil.rmtree(file_path)

db.save_database(db_dir)
# Can use db.save, db.save_db, or db.save_database
db.save(db_dir)

# Check JSON data
assert os.path.exists(os.path.join(db_dir, "reference", 'Publications.json'))
Expand Down

0 comments on commit 24a4749

Please sign in to comment.