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 17 commits into
base: develop
Choose a base branch
from
Draft

Feature/pymetkit #56

wants to merge 17 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 Report

Attention: Patch coverage is 0% with 180 lines in your changes missing coverage. Please review.

Project coverage is 58.70%. Comparing base (963c295) to head (47681bb).

Files with missing lines Patch % Lines
src/metkit/api/metkit_c.cc 0.00% 180 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #56      +/-   ##
===========================================
- Coverage    60.39%   58.70%   -1.70%     
===========================================
  Files          101      102       +1     
  Lines         6242     6422     +180     
  Branches       585      590       +5     
===========================================
  Hits          3770     3770              
- Misses        2472     2652     +180     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

import findlibs
from typing import IO, Iterator

__metkit_version__ = "1.11.0"
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: use the VERSION file

build-backend = "setuptools.build_meta"

[project]
name = "metkit-python"
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-python -> pymetkit everywhere


[project]
name = "metkit-python"
version = "0.0.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

Will we have one version of metkit/pymetkit together, or separate versioning?

lib.metkit_request_params(self.__request, cparams)
self._cdata = ffi.gc(cparams[0], lib.metkit_free_paramiterator)

while lib.metkit_paramiterator_next(self._cdata) == lib.METKIT_SUCCESS:
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: next() should be at the end of this loop, not the beginning, as it skips the first element.
Happens to cancel out an error in the metkit_c, which nullifies the first call to next().

lib.metkit_request_params(self.__request, cparams)
self._cdata = ffi.gc(cparams[0], lib.metkit_free_paramiterator)

while lib.metkit_paramiterator_next(self._cdata) == lib.METKIT_SUCCESS:
Copy link
Member Author

Choose a reason for hiding this comment

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

Same problem as request iterator, see comment.

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.

4 participants