Skip to content
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

Draft
wants to merge 21 commits into
base: develop
Choose a base branch
from
Draft

Feature/pymetkit #56

wants to merge 21 commits into from

Conversation

ChrisspyB
Copy link
Member

@ChrisspyB ChrisspyB commented Dec 9, 2024

Python interface, based on initial implementation by @jinmannwong.

wip

@FussyDuck
Copy link

FussyDuck commented Dec 9, 2024

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 62.64%. Comparing base (3597d60) to head (ddf611d).

Files with missing lines Patch % Lines
src/metkit/api/metkit_c.cc 25.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisspyB
Copy link
Member Author

Note Should not be merged until #57 is merged.

@ChrisspyB ChrisspyB changed the base branch from develop to feature/c-api March 12, 2025 17:14
@ChrisspyB ChrisspyB requested review from tbkr, simondsmart and jinmannwong and removed request for simondsmart March 19, 2025 17:40
assert "class" in requests[0]
assert requests[1]["levelist"] == "500"

# @todo: [1] no longer raises an exception. Is this correct?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo.

expanded.validate()
assert req == expanded

# @todo: [0] and [1] no longer raise an exception. Is this correct?
Copy link
Member Author

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);
Copy link
Contributor

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.

Copy link
Member Author

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);
Copy link
Contributor

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?

Copy link
Member Author

@ChrisspyB ChrisspyB Mar 24, 2025

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

Base automatically changed from feature/c-api to develop March 25, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants