new tutorials for C api - #320
Conversation
fd943bc to
eb2c093
Compare
947dec7 to
32a2662
Compare
Luthaf
left a comment
There was a problem hiding this comment.
So this needs a bit more cleanup/organization before I can have a detailed look.
A lot of the prose still reads as LLM-generated and should be rewritten with your own words. Most tutorials would also benefit from having more comments and smaller blobs of code.
There are also a couple of tutorials I'm not sure are pulling their weight; mainly the symd one and the string/error/units one.
|
This should also be rebased on top of metatomic-core, not main =) |
5d51d81 to
57a6659
Compare
Thanks! I cleaned up the tutorial (LLM slop, temporary files, other garbage) and rebased/squashed into 1 commit |
9dd11f5 to
02021e8
Compare
deleted old files, and reordered examples del old file Refactor C API tutorials (clean slop) includes refining comments, enhancing explanations of DLPack tensor usage, and restructuring the tutorial flow for better understanding. typo - and some expected output Enhance C API tutorials with improved explanations and structure Refactor the examples to clarify the integration of DLPack tensors with existing simulation data. Update comments for better understanding of tensor creation and usage, and streamline the tutorial flow. Additionally, ensure consistency in terminology and enhance the overall readability of the code. Add inclusion of `<inttypes.h>` in `3-add-model.c` for consistent usage of PRIx64 across examples
02021e8 to
b116816
Compare
| build_doxygen_docs() | ||
| generate_examples() | ||
|
|
||
| app.connect("builder-inited", add_extra_files_to_zips, priority=600) |
There was a problem hiding this comment.
600 is a magic number, or is there some rule to this?
There was a problem hiding this comment.
it is above the default priority of 500 (which is used by sphinx-gallery), to make sure we run after it generated the initial zip
There was a problem hiding this comment.
Would you consider making this it's own example? seems like it would be useful to others
There was a problem hiding this comment.
It is already mostly a copy of the code in the first tutprial
| int64_t* shape; | ||
| int64_t* strides; | ||
| } CustomDLPackContext; | ||
|
|
There was a problem hiding this comment.
Nice, that's a lot cleaner
| struct mts_array_t prop_array = make_mts_array( | ||
| distance_values, 2, (uintptr_t[]){1, 1}, | ||
| (DLDataType){.code = kDLInt, .bits = 32, .lanes = 1}, 1 | ||
| distance_values, (uintptr_t[]){1, 1}, 2, i32_dtype |
|
|
||
| // %% | ||
| // | ||
| // A minimal model |
b116816 to
af0fc27
Compare
EricBoittier
left a comment
There was a problem hiding this comment.
Nicely done. Tutorial 4 reads much better now, too.
af0fc27 to
e79bc37
Compare
- add helpers in utils/, included in zip - simplify parts of the code - add a bunch of explanations
e79bc37 to
f820926
Compare
Co-authored-by: Guillaume Fraux <guillaume.fraux@epfl.ch>
Co-authored-by: Guillaume Fraux <guillaume.fraux@epfl.ch>
Co-authored-by: Guillaume Fraux <guillaume.fraux@epfl.ch>
Co-authored-by: Guillaume Fraux <guillaume.fraux@epfl.ch>
Co-authored-by: Guillaume Fraux <guillaume.fraux@epfl.ch>
Adds additional examples/tutorials to the C api section
these changes should go on top of #313 and the hot fix for MSVC (the windows C/C++ compiler)
Contributor (creator of pull-request) checklist
Reviewer checklist