unitaryfund / metriq-client

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

Added examples for results API endpoints #75

Closed AVDiv closed 1 year ago

AVDiv commented 1 year ago

Added examples for results API except for results_add.py because it was already there. Open for any improvements suggestions. Closes #73

AVDiv commented 1 year ago

@vprusso @WrathfulSpatula Any improvements to be done?

vprusso commented 1 year ago

Looks good overall, @AVDiv !

Would you mind adding at least one or two more result items for the metric_names endpoint? Aside from that, I think it's good to go!

AVDiv commented 1 year ago

I'll work on it

AVDiv commented 1 year ago

Looks good overall, @AVDiv !

Would you mind adding at least one or two more result items for the metric_names endpoint? Aside from that, I think it's good to go!

Hey, I just started looking on this, I don't get what you meant by one or two more result items? Can you please explain a bit further?

vprusso commented 1 year ago

Looks good overall, @AVDiv ! Would you mind adding at least one or two more result items for the metric_names endpoint? Aside from that, I think it's good to go!

Hey, I just started looking on this, I don't get what you meant by one or two more result items? Can you please explain a bit further?

Sure, let me try and clarify what I was suggesting.

For the code example you contributed in examples/result_metric_names.py

I was wondering if you could add a few additional result items, that is:

from metriq import MetriqClient
from metriq.models.result import ResultCreateRequest

result = ResultCreateRequest()
result.task = "176"
result.method = "84"
result.metricName = "Test Metric"
result.metricValue = "10"
result.evaluatedAt = "2021-07-22"
result.isHigherBetter = "true"
result.qubitCount = "2"

result2 = ResultCreateRequest()
....

result3 = ResultCreateRequest()
....

client = MetriqClient(token="[Get this token from your web app account, and replace this string with it.]")
client.result_add(result)
client.result_add(result2)
client.result_add(result3)
print(client.result_metric_names())
AVDiv commented 1 year ago

Right, got it. Thank you

AVDiv commented 1 year ago

@vprusso I think this is it, Please check if anything to be improved?

vprusso commented 1 year ago

Great. Thanks for the contribution, @AVDiv . I've made sure to assign you as well so you are able to claim credit for this issue. Thank you again, and hope to see you around on this project again in the future!

AVDiv commented 1 year ago

Thank you @vprusso, Can you please assign me to the issue and mark the issue as done on unitaryhack.dev?

vprusso commented 1 year ago

You should already be assigned this issue (you can check that by looking at the "Assignees" tab on the right of the issue). If I missed it, let me know, but from what I'm seeing now, you are assigned to this. Let me know if that's not the case on your end @AVDiv

AVDiv commented 1 year ago

Actually, I'm only assigned to the this PR, please check on the issue linked to this PR, I'm not assigned on it. The issue thread: #73