Skip to content

Commit

Permalink
fix change to default table name
Browse files Browse the repository at this point in the history
fix change to default table name
  • Loading branch information
mschwamb committed Dec 31, 2023
1 parent d903a3f commit 09897ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/sorcha/utilities/createResultsSQLDatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from sorcha.modules.PPConfigParser import PPFindDirectoryOrExit


def create_results_table(cnx_out, filename, output_path, output_stem, table_name="sorcha_results"):
def create_results_table(cnx_out, filename, output_path, output_stem, table_name="pp_results"):
"""
Creates a table in a SQLite database from SSPP results.
Expand All @@ -35,7 +35,7 @@ def create_results_table(cnx_out, filename, output_path, output_stem, table_name
stem filename for SSPP outputs.
table_name : string, optional
name of table of for storing sorcha results. Default ="sorcha_results"
name of table of for storing sorcha results. Default ="pp_results"
Returns
-----------
Expand Down Expand Up @@ -156,7 +156,7 @@ def create_results_database(args):
create_inputs_table(cnx_out, "comet")


def get_column_names(filename, table_name="sorcha_results"):
def get_column_names(filename, table_name="pp_results"):
"""
Obtains column names from a table in a SQLite database.
Expand All @@ -166,7 +166,7 @@ def get_column_names(filename, table_name="sorcha_results"):
Filepath/name of sqlite3 database.
table_name : string, optional
Name of table. Default = "sorcha_results"
Name of table. Default = "pp_results"
Returns
-----------
Expand Down
4 changes: 2 additions & 2 deletions tests/sorcha/test_createResultsSQLDatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_create_results_table(tmp_path):

cnx_in = sqlite3.connect(os.path.join(tmp_path, "test_results_table.db"))
cur = cnx_in.cursor()
cur.execute("select * from sorcha_results")
cur.execute("select * from pp_results")
col_names = list(map(lambda x: x[0], cur.description))
test_inputs = pd.DataFrame(cur.fetchall(), columns=col_names)
cnx_out.close()
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_create_results_database(tmp_path):
col_names = list(map(lambda x: x[0], cur.description))
test_orbits = pd.DataFrame(cur.fetchall(), columns=col_names)

cur.execute("select * from sorcha_results")
cur.execute("select * from pp_results")
col_names = list(map(lambda x: x[0], cur.description))
test_results = pd.DataFrame(cur.fetchall(), columns=col_names)

Expand Down

0 comments on commit 09897ad

Please sign in to comment.