This article explains how to download additional solve metadata for a completed solve using rosepy. You can also retrieve solve metadata directly via the API, available for any language. For that, see the API specific help article.
Prerequisites
- Your API key must be specified in the environment variable
ROSEPY_API_KEY_SECRET. If you need to create an API key, the steps for doing that can be found in the article on Creating an API key. - Having a solve ID to pass in for the
solve_idvariable. You can get this from:- If using the API to submit your solves, the response to the
/solveendpoint is a list of solve ID(s) - If looking through the web UI, the solve ID can be found in the URL where it says
id=, for example this solve ID is 1234./solve?id=1234
- If using the API to submit your solves, the response to the
Sample Code Snippet
Running the below returns a Python dictionary with solve metadata such as solve time, number of variables, and solver status. The actual solution values are not included, use the web interface or the API /solution endpoint to access the solution. If the solve ID is invalid or not yet complete, get_solve_results will raise an exception and return None.
from rosepy.solver import Solver
solve_id = "<populate your solve ID here>"
solver = Solver()
solve = solver.get_solve(solve_id)
solver.disconnect()
solver.shutdown_event.set()
Comments
0 comments
Please sign in to leave a comment.