Driver recording in openMDAO

61 Views Asked by At

I have the following code to record the driver cases:

recorder = om.SqliteRecorder('cases.sql')
prob.driver.add_recorder(recorder)

...

prob.run_driver()

...

cr = om.CaseReader("cases.sql")

driver_cases = cr.get_cases('driver', recurse=False)
last_case = cr.get_case(driver_cases[-1])

I'm getting the following error on last line:

cur.execute("SELECT * FROM driver_iterations WHERE " sqlite3.InterfaceError: Error binding parameter :iteration_coordinate - probably unsupported type.

What may be the reason?

1

There are 1 best solutions below

1
Rob Falck On

Once you have driver_cases, obtained from the get_cases method you can simply issue

last_case = driver_cases[-1]

Alternatively, you can use cr.list_cases() to list the cases that way, which returns a string identifier for each case. Passing that string to get_case should then give you what you want.

cases = cr.list_cases('driver')
last_case = cr.get_case(cases[-1])