Skip to content

Commit 24a4749

Browse files
authored
Create alias for save method (#98)
1 parent 0112ab7 commit 24a4749

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

astrodbkit/astrodb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,9 @@ def __init__(
358358
connection_string, sqlite_foreign=sqlite_foreign, connection_arguments=connection_arguments
359359
)
360360

361-
# Convenience methods
361+
# Convenience methods and aliases
362362
self.query = self.session.query
363+
self.save = self.save_database
363364
self.save_db = self.save_database
364365
self.load_db = self.load_database
365366

astrodbkit/tests/test_astrodb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ def test_save_database(db, db_dir):
450450
elif os.path.isdir(file_path):
451451
shutil.rmtree(file_path)
452452

453-
db.save_database(db_dir)
453+
# Can use db.save, db.save_db, or db.save_database
454+
db.save(db_dir)
454455

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

0 commit comments

Comments
 (0)