You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tutorials for tskit in other languages (C & Rust) #105
We have a fully functional short tskit & R tutorial. I wonder if it's worth having a part of the tutorials book on other languages and include a (short) C example and a Rust example? I'm guessing @molpopgen would be the one to do this, if he has any time.
I can do one for the rust interface. Unfortunately (IMO) I think it has to be a notebook rather than myst-md. The way one specifies the dependencies for a rust notebook is not allowed in the markdown. I've know this for a while but haven't had the time to figure out where to file the issue (jupyter-book or the rust kernel authors, or both, or neither).
This is low on the short-term priority list, though.
This is low on the short-term priority list, though.
Yes, absolutely. I only opened this issue so as not to forget it. We could either leave it as an open issue or make a tutorial stub and just fill it with a "todo"
To follow up on this (which some recent Slack posts reminded me of): a literate tutorial for tskit-rust is unlikely unless we start using RMarkdown/knitr. I recently closed a PR based on mdbook due to the amount of work required. The current goal is to get a working example for all elements of the public API. An example is here and the next release will have many more. But it is slow to get it all done.
EDIT: sigh, it looks like Rmd/rextendr are still tricky to get working.
---title: "tskit-rust tutorial"author: Kevin Thornton / tskit-developersoutput: html_document---```{r, echo=FALSE}
library(rextendr)```# Adding a node to a `TableCollection`.
```{extendr engine.opts = list(dependencies = list(`tskit` = "0.9.0"))}
let mut tables = tskit::TableCollection::new(100.0).unwrap();
// Node flags, birth time, population id, individual id
let node_id = tables.add_node(0, 0.0, tskit::PopulationId::NULL, tskit::IndividualId::NULL).unwrap();
// The type tskit::NodeId can be compared to i32
assert_eq!(node_id, 0);
```
Activity
jeromekelleher commentedon Jun 24, 2021
Certainly a C one would be nice. We can adapt some of the content in the C API page.
petrelharp commentedon Jun 24, 2021
Hah, for a moment I thought this meant eg in spanish, and wondered why the first spanish tutorial would be about rust.
hyanwong commentedon Jun 24, 2021
Cierto en Espagnol. Moi je peux traduire en Français si vous voulez :)
molpopgen commentedon Jun 24, 2021
I can do one for the rust interface. Unfortunately (IMO) I think it has to be a notebook rather than myst-md. The way one specifies the dependencies for a rust notebook is not allowed in the markdown. I've know this for a while but haven't had the time to figure out where to file the issue (jupyter-book or the rust kernel authors, or both, or neither).
This is low on the short-term priority list, though.
hyanwong commentedon Jun 24, 2021
Yes, absolutely. I only opened this issue so as not to forget it. We could either leave it as an open issue or make a tutorial stub and just fill it with a "todo"
molpopgen commentedon Jul 11, 2022
To follow up on this (which some recent Slack posts reminded me of): a literate tutorial for tskit-rust is unlikely unless we start using RMarkdown/knitr. I recently closed a PR based on
mdbookdue to the amount of work required. The current goal is to get a working example for all elements of the public API. An example is here and the next release will have many more. But it is slow to get it all done.EDIT: sigh, it looks like Rmd/rextendr are still tricky to get working.molpopgen commentedon Jul 11, 2022
For posterity: