Skip to content
Snippets Groups Projects
Commit a0d93268 authored by Jan Müller's avatar Jan Müller
Browse files

Fix get_simulation_time_info

parent 48e86319
Branches
No related tags found
1 merge request!4Feature/add arbor support
......@@ -12,7 +12,7 @@ import requests
import psycopg2
def SetupDB(postgres_username, postgres_password, port):
def SetupNestDB(postgres_username, postgres_password, port):
con = psycopg2.connect(database="postgres", user=postgres_username,
password=postgres_password, host="database", port=str(port))
print("Database connection opened successfully!")
......@@ -54,7 +54,7 @@ def SetupDB(postgres_username, postgres_password, port):
def main():
# Connect to the Database and initalize basic Table structure
SetupDB('postgres', 'docker', 5432)
SetupNestDB('postgres', 'docker', 5432)
# get info node
with open('access_node//info_node.json', 'r') as f:
......
......@@ -228,9 +228,12 @@ def nest_get_simulation_time_info(): # noqa: E501
password="docker", host="database", port="5432")
cur = con.cursor()
cur.execute("SELECT MAX(CURRENT_SIM_TIME) FROM SIMULATION_NODES")
time = cur.fetchall()[0][0]
return time
cur.execute("SELECT MIN(CURRENT_SIM_TIME) FROM SIMULATION_NODES")
current_time = cur.fetchall()[0][0]
# TODO Add Start and End time when available
time_info = SimulationTimeInfo(current=current_time)
return time_info
def nest_get_spikes(_from=None, to=None, gids=None, offset=None, limit=None): # noqa: E501
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment