Skip to content

Commit

Permalink
Fix errors in lamber_scanner SQLite db table name.
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikkumar committed Mar 26, 2015
1 parent 176b488 commit 7b32571
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/plot_lambert_scan_maps.json.empty
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// - argument_of_periapsis
// - longitude_of_ascending_node
// The map order is generated based on the corresponding departure column in the
// lambert_scan_results table in the SQLite database.
// lambert_scanner_results table in the SQLite database.
"map_order" : "",

// Directory where scan figure is stored.
Expand Down
4 changes: 2 additions & 2 deletions python/plot_lambert_scan_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@
# Fetch scan data.
map_order = "departure_" + config['map_order']
scan_data = pd.read_sql("SELECT departure_object_id, arrival_object_id, min(transfer_delta_v) \
FROM lambert_scan_results \
FROM lambert_scanner_results \
GROUP BY departure_object_id, arrival_object_id;", \
database)
scan_data.columns = ['departure_object_id','arrival_object_id','transfer_delta_v']
scan_map = scan_data.pivot(index='departure_object_id', \
columns='arrival_object_id', \
values='transfer_delta_v')
scan_order = pd.read_sql("SELECT DISTINCT departure_object_id, " + map_order + " \
FROM lambert_scan_results \
FROM lambert_scanner_results \
ORDER BY " + map_order + " ASC", \
database)
scan_map = scan_map.reindex(index=scan_order['departure_object_id'], \
Expand Down
11 changes: 6 additions & 5 deletions test/testLambertScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ TEST_CASE( "Test execution of lambert_scanner application mode", "[lambert-scann
SQLite::Database database( databasePathConfig.GetString( ), SQLITE_OPEN_READONLY );
SQLite::Database databaseExpected( databaseExpectedPath.c_str( ), SQLITE_OPEN_READONLY );

SQLite::Statement query( database, "SELECT * FROM lambert_scan_results;" );
SQLite::Statement queryExpected( databaseExpected, "SELECT * FROM lambert_scan_results;" );
SQLite::Statement query( database, "SELECT * FROM lambert_scanner_results;" );
SQLite::Statement queryExpected(
databaseExpected, "SELECT * FROM lambert_scanner_results;" );

while ( query.executeStep( ) )
{
Expand Down Expand Up @@ -282,12 +283,12 @@ TEST_CASE( "Test function to check input to lambert scanner", "[lambert-scanner]
std::cout.rdbuf( coutBuffer );
}

TEST_CASE( "Test creation of lambert_scan_results table in SQLite database",
TEST_CASE( "Test creation of lambert_scanner_results table in SQLite database",
"[lambert-scanner],[input-output]" )
{
// Set database path, table name, and open database in read/write mode.
const std::string databasePath = getRootPath( ) + "/test/lambert_scanner_test.db";
const std::string tableName = "lambert_scan_results";
const std::string tableName = "lambert_scanner_results";
SQLite::Database database( databasePath.c_str( ), SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE );

// Create table and check if it is created correctly.
Expand All @@ -305,7 +306,7 @@ TEST_CASE( "Test writing transfer shortlist to file", "[lambert-scanner],[input-
// Set database path, table name, shortlist path, expected shortlist path and open database in
// read mode.
const std::string databasePath = getRootPath( ) + "/test/lambert_scanner_expected.db";
const std::string tableName = "lambert_scan_results";
const std::string tableName = "lambert_scanner_results";
const std::string shortlistAbsolutePath = getRootPath( ) + "/test/" + shortlistPath;
const std::string shortlistExpectedPath
= getRootPath( ) + "/test/lambert_scanner_shortlist_expected.csv";
Expand Down

0 comments on commit 7b32571

Please sign in to comment.