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

Consistent ffi #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Consistent ffi #22

wants to merge 5 commits into from

Conversation

jhod0
Copy link
Contributor

@jhod0 jhod0 commented Aug 7, 2019

This PR makes two main changes for consistent interfacing with C code, and error handling:

  • Passing arrays to C routines is now handled with the _ArrayWrapper class, which always ensures arrays are the right type, and contiguous in memory (to avoid memory corruption). It also consistently handles passing single values to C routines.
  • C routines using GSL functions now return the GSL error code to the Python wrapper. If retcode != GSL_SUCCESS, an error is thrown in Python. This ensures that errors are always detected, and makes it possible to handle them explicitly in Python.

@jhod0
Copy link
Contributor Author

jhod0 commented Aug 7, 2019

Seems like the first bullet above addresses #9 as well

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.

2 participants