https://github.com/csiro-hydroinformatics/c-interop

Reusable functions for marshalling data between C, C++ and other programming languages

https://github.com/csiro-hydroinformatics/c-interop

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 2 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.6%) to scientific vocabulary

Keywords

glue-code interop interoperability marshalling-data python rcpp
Last synced: 5 months ago · JSON representation

Repository

Reusable functions for marshalling data between C, C++ and other programming languages

Basic Info
  • Host: GitHub
  • Owner: csiro-hydroinformatics
  • License: other
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 343 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • Open Issues: 4
  • Releases: 0
Topics
glue-code interop interoperability marshalling-data python rcpp
Created about 9 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

Reusable functions for marshalling data between C, C++ and other programming languages

license status Python package doc

Python package: license status Documentation Status codecov master: Python package testing: Python package

Purpose and context

This repository contains reusable material for interoperability between C/C++ and other languages such as python, R, etc. It is using template-only C++, avoiding code duplications across several projects. The code design also stems from learning over the years to prevent some "gotchas" one can get into when diving deep in native interop accross compilation modules.

Content

The C++ header files cover interop for:

  • common base types (characters, numeric, and vectors thereof)
  • boost date-time
  • time series (inherited from its usage in time step modelling systems)

The repo also includes interop packages for several higher level languages, that helps handling consistently (including memory management...) some of the data stemming from the C/C++ glue code:

Related work, use cases

One use case arising from hydrologic forecasting is uchronia-time-series.

Some features in the present repository depend on related material:

  • moirai, a C++ library designed to help handling C++ objects from so-called opaque pointers, via a C API.
  • The python package refcount for reference counting external resources.

Another resource is a blog post on generating programming language bindings to a C API.

Example

For instance this library defines a template function to_custom_character_vector to convert C char** types to something useful for the higher level language at hand.

c++ namespace cinterop { namespace utils { template<typename T> T to_custom_character_vector(char** names, int size, bool cleanup);

One specialization of this is a conversion to Rcpp's CharacterVector type for interop with R, which would be used like this:

c++ int size; char** values = GetEnsembleDatasetDataIdentifiers(dataLibrary->get(), &size); CharacterVector cv = to_custom_character_vector<CharacterVector>(values, size, true);

Related work

Owner

  • Name: CSIRO Hydroinformatics
  • Login: csiro-hydroinformatics
  • Kind: organization

CSIRO - hydroinformatics repositories

GitHub Events

Total
  • Issues event: 3
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 14
  • Pull request event: 9
  • Create event: 5
Last Year
  • Issues event: 3
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 14
  • Pull request event: 9
  • Create event: 5

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 169
  • Total Committers: 2
  • Avg Commits per committer: 84.5
  • Development Distribution Score (DDS): 0.089
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
J-M j****d@c****u 154
Jean-Michel Perraud p****2@c****u 15
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 8
  • Total pull requests: 9
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 13 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.88
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 2
  • Pull requests: 9
  • Average time to close issues: 7 months
  • Average time to close pull requests: 13 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 8
Top Authors
Issue Authors
  • jmp75 (8)
Pull Request Authors
  • dependabot[bot] (8)
  • jmp75 (1)
Top Labels
Issue Labels
bug (2) enhancement (1)
Pull Request Labels
dependencies (8)

Dependencies

bindings/R/pkgs/cinterop/DESCRIPTION cran
  • R >= 3.5 depends
  • lubridate * imports
  • methods * imports
  • stringr * imports
  • xts * imports
  • zoo * imports
  • knitr * suggests
  • rmarkdown * suggests
bindings/python/cinterop/docs/requirements.txt pypi
  • cffi >=1.11.5
  • mkdocs *
  • mkdocs-material *
  • mkdocs-material-extensions *
  • mkdocstrings *
  • mkdocstrings-python *
  • mock *
  • numpy *
  • pandas *
  • pillow *
  • recommonmark *
  • refcount >=1.1.1
  • six *
  • typing-extensions >=4.3.0
  • xarray *
bindings/python/cinterop/requirements.txt pypi
  • cffi >=1.11.5
  • numpy *
  • pandas *
  • refcount >=1.1.1
  • six *
  • typing-extensions >=4.3.0
  • xarray *
bindings/python/cinterop/tests/requirements.txt pypi
  • mypy >=0.971 test
  • pytest-cov >=3.0.0 test
bindings/python/cinteroppyb11/setup.py pypi
  • pybind11 >=2.2
.github/workflows/python-cinterop.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • codecov/codecov-action v3 composite
bindings/python/cinterop/setup.py pypi
bindings/python/cinterop/docs/environment.yml conda
  • cffi
  • mkdocs
  • mkdocs-material
  • mkdocs-material-extensions
  • mkdocstrings
  • numpy
  • pandas
  • refcount
  • xarray
bindings/python/cinterop/poetry.lock pypi
  • bleach 6.0.0
  • cached-property 1.5.2
  • certifi 2024.8.30
  • cffi 1.15.1
  • charset-normalizer 3.4.0
  • click 8.1.7
  • click-log 0.4.0
  • colorama 0.4.6
  • coverage 7.2.7
  • cryptography 43.0.3
  • docutils 0.20.1
  • dotty-dict 1.3.1
  • exceptiongroup 1.2.2
  • ghp-import 2.1.0
  • gitdb 4.0.11
  • gitpython 3.1.43
  • griffe 0.30.1
  • idna 3.10
  • importlib-metadata 6.7.0
  • importlib-resources 5.12.0
  • iniconfig 2.0.0
  • invoke 2.2.0
  • jaraco-classes 3.2.3
  • jeepney 0.8.0
  • jinja2 3.1.5
  • keyring 24.1.1
  • markdown 3.4.4
  • markupsafe 2.1.5
  • mergedeep 1.3.4
  • mkdocs 1.5.3
  • mkdocs-autorefs 0.4.1
  • mkdocstrings 0.19.1
  • mkdocstrings-python 0.7.1
  • more-itertools 9.1.0
  • mypy 0.971
  • mypy-extensions 1.0.0
  • packaging 24.0
  • pathspec 0.11.2
  • pkginfo 1.10.0
  • platformdirs 4.0.0
  • pluggy 1.2.0
  • pycparser 2.21
  • pydantic 1.10.18
  • pygments 2.17.2
  • pymdown-extensions 10.2.1
  • pytest 7.4.4
  • pytest-cov 3.0.0
  • python-dateutil 2.9.0.post0
  • python-gitlab 3.15.0
  • python-semantic-release 7.34.6
  • pywin32-ctypes 0.2.3
  • pyyaml 6.0.1
  • pyyaml-env-tag 0.1
  • readme-renderer 37.3
  • refcount 1.2.5
  • requests 2.31.0
  • requests-toolbelt 1.0.0
  • rfc3986 2.0.0
  • secretstorage 3.3.3
  • semver 2.13.0
  • six 1.16.0
  • smmap 5.0.1
  • tomli 2.0.1
  • tomlkit 0.12.5
  • tqdm 4.66.6
  • twine 3.8.0
  • typed-ast 1.5.5
  • typing-extensions 4.7.1
  • urllib3 2.0.7
  • watchdog 3.0.0
  • webencodings 0.5.1
  • wheel 0.42.0
  • zipp 3.15.0
bindings/python/cinterop/pyproject.toml pypi
  • mkdocs ^1.3.0 develop
  • mkdocs-autorefs ^0.4.1 develop
  • mkdocstrings ^0.19.0 develop
  • mkdocstrings-python ^0.7.1 develop
  • mypy ^0.971 develop
  • pydantic ^1.9.1 develop
  • pytest ^7.1.2 develop
  • pytest-cov ^3.0.0 develop
  • python-semantic-release ^7.29.7 develop
  • cffi ^1.11.5
  • python ^3.7
  • refcount ^1.0.0