Skip to content

C api tutorials - #311

Merged
EricBoittier merged 5 commits into
metatensor:metatomic-corefrom
EricBoittier:c-api-tutorials
Sep 2, 2026
Merged

C api tutorials#311
EricBoittier merged 5 commits into
metatensor:metatomic-corefrom
EricBoittier:c-api-tutorials

Conversation

@EricBoittier

@EricBoittier EricBoittier commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Expand the C API tutorial gallery with practical examples built on top of the
existing 1-create-system tutorial:

  • 1-create-system.c: query length unit plus types, positions, cell, and
    PBC via mta_system_get_data, and document the expected stdout.
  • 2-add-model.c (WIP stub): fill an mta_model_t vtable, register it
    through a plugin, and print formatted metadata. execute_inner (energy
    TensorMaps and forces) is deferred to a follow-up PR.
  • 3-add-plugin.c: demonstrate in-process mta_register_plugin /
    mta_load_model, unknown-model error handling, and the
    MTA_REGISTER_PLUGIN shared-library pattern.
  • 4-strings-errors-units.c: cover mta_string_t, unit conversion,
    last-error handling, and mta_format_metadata, citing the published
    metatensor/metatomic paper (https://doi.org/10.1063/5.0304911).
  • Mark the C tutorials section as WIP in examples/c/README.rst.

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

Luthaf and others added 3 commits August 31, 2026 16:40
Expand the C gallery with richer system queries, a harmonic Einstein-solid
model, plugin registration, and strings/errors/units helpers. Mark the
section as WIP and cite the published metatomic paper in the metadata demo.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EricBoittier
EricBoittier marked this pull request as ready for review September 2, 2026 09:41
@EricBoittier
EricBoittier changed the base branch from main to metatomic-core September 2, 2026 09:42
EricBoittier and others added 2 commits September 2, 2026 11:57
Leave execute_inner unimplemented so CI is not blocked by the
hand-rolled DenseArray backend. Energy and forces can follow in a later PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EricBoittier
EricBoittier merged commit dde1cd4 into metatensor:metatomic-core Sep 2, 2026
74 checks passed
@Luthaf

Luthaf commented Sep 2, 2026

Copy link
Copy Markdown
Member

This should have been reviewed before merging, I undid the merge and we can re-open!

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