-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/pymetkit #56
base: develop
Are you sure you want to change the base?
Feature/pymetkit #56
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/c-api #56 +/- ##
=================================================
- Coverage 62.67% 62.64% -0.03%
=================================================
Files 106 106
Lines 6725 6728 +3
Branches 634 634
=================================================
Hits 4215 4215
- Misses 2510 2513 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Note Should not be merged until #57 is merged. |
pymetkit/tests/test_marsrequest.py
Outdated
assert "class" in requests[0] | ||
assert requests[1]["levelist"] == "500" | ||
|
||
# @todo: [1] no longer raises an exception. Is this correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo.
pymetkit/tests/test_marsrequest.py
Outdated
expanded.validate() | ||
assert req == expanded | ||
|
||
# @todo: [0] and [1] no longer raise an exception. Is this correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo.
|
||
metkit_error_t metkit_paramiterator_delete(const metkit_paramiterator_t* it); | ||
metkit_iterator_status_t metkit_paramiterator_next(metkit_paramiterator_t* it); | ||
metkit_iterator_status_t metkit_paramiterator_current(const metkit_paramiterator_t* it, const char** param); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to have a parameter iterator, at least make it able to return the number of values and the values as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment
metkit_error_t metkit_marsrequest_set_verb(metkit_marsrequest_t* request, const char* verb); | ||
metkit_error_t metkit_marsrequest_verb(const metkit_marsrequest_t* request, const char** verb); | ||
metkit_error_t metkit_marsrequest_has_param(const metkit_marsrequest_t* request, const char* param, bool* has); | ||
metkit_error_t metkit_marsrequest_params(const metkit_marsrequest_t* request, metkit_paramiterator_t** params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced you need a params iterator, as opposed to just returning them by count/index in the same way as you do for the values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the existing C++ implementation, it is not possible to return the params without making a copy (they internally stored in a linked list), unlike the values, so they are less suitable for accessing by index and count
Python interface, based on initial implementation by @jinmannwong.
wip