unitaryfund / metriq-client

Fork of papers-with-code client
https://metriq.info
Apache License 2.0
3 stars 9 forks source link

Route network issue 85 #93

Closed QuantumAli closed 1 year ago

QuantumAli commented 1 year ago

This one I am a little bit more unsure about. Because the API endpoint shows "readNetworkGraph" so should the results be numerical or should they be visual ie a graph?

vprusso commented 1 year ago

This one I am a little bit more unsure about. Because the API endpoint shows "readNetworkGraph" so should the results be numerical or should they be visual ie a graph?

@QuantumAli I imagine the graph relationships would be encoded in a Python dictionary. Can you confirm this by printing out the contents of client.task_get_network()?

QuantumAli commented 1 year ago

The contents that get posted are as follows

id = none  userID = none   name=none  fullName = none  description=none  submittedDate=none  deletedDate =none
vprusso commented 1 year ago

The contents that get posted are as follows

id = none  userID = none   name=none  fullName = none  description=none  submittedDate=none  deletedDate =none

@QuantumAli This is because you are trying to shove the return of a task network into a task.

That is, you are trying to take the response of the taskNetwork endpoint and encode it into the fields of the Task class.

You will need to define a TaskNetwork class in models/ that houses the fields obtained from the JSON response.

Does that make sense?

For reference, here is what some of the output looks like when hitting the taskNetwork endpoint:

{
    "message": "Retrieved task network graph.",
    "data": {
        "nodes": [
            {
                "index": 0,
                "name": "MAXCUT: 3-regular",
                "group": 59
            },
            {
                "index": 1,
                "name": "CLOPS-qiskit-runtime",
                "group": 56
            },
    ....
    }
}