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

Add TableCollection functions to consume "row" objects #116

Open
molpopgen opened this issue May 11, 2021 · 0 comments
Open

Add TableCollection functions to consume "row" objects #116

molpopgen opened this issue May 11, 2021 · 0 comments

Comments

@molpopgen
Copy link
Member

molpopgen commented May 11, 2021

Named arguments are handy. Rust only really allows them for struct construction. So, we can "fake it" with an API like:

tables.add_node_table_row(NodeTableRow{ flags: 0, time: 0.1243, population: 2, individual: TSK_NULL, metadata: None }).unwrap()

Just have to check what the visibility of the row objects is. They are public, but maybe not currently from the crate root?

This is certainly undesirable to do "everywhere", but it is handy for the row adding fxns that are a bit long. The other functions that are long on the Python side are often shorter on the C side to to bit flags.

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

No branches or pull requests

1 participant