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

Why is this no longer in main spglib repo? #3

Open
LecrisUT opened this issue Mar 1, 2023 · 5 comments
Open

Why is this no longer in main spglib repo? #3

LecrisUT opened this issue Mar 1, 2023 · 5 comments

Comments

@LecrisUT
Copy link

LecrisUT commented Mar 1, 2023

No description provided.

@seatonullberg
Copy link
Collaborator

I wrote this a long time ago, but I remember that the bindings were moved to their own repo to make the documentation generation more convenient. Things may have changed with the organization of spglib that would make this separate repo unnecessary but I have not reviewed the codebase recently. Having a separate repo also serves the purpose of insulating this wrapper code from the main codebase which can be desirable when there are no regular maintainers of the spglib project who know Rust. If there were Rust-fluent maintainers it might make more sense to bring this code back in.

In summary, I would be cautious about moving this wrapper back into the main repo before it can be confirmed that documentation generation with Cargo runs as expected. I am happy to help but my time is limited as I am in the last year of my PhD program.

@LecrisUT
Copy link
Author

LecrisUT commented Mar 1, 2023

We have moved to readthedocs so if it can be refactored to be specific pages we should be able to merge this.

Ideally we would want it together so we can run the CIs on it as well.

I would push for something automated like SWIG, but I've seen that there is no rust functionality for that yet and it needs more improvement to become easily integrateable for spglib. Do you know of a similar rust available tool for that for either C or C++ api binding?

@seatonullberg
Copy link
Collaborator

Cargo generates html files that could be linked to from any documentation page. I wouldn't recommend trying to generate rust documentation with another tool because 1) I don't know of any that are mature and 2) It would be very unfamiliar in the Rust community to read documentation not in the Cargo style. I think it makes more sense to put the effort into a build script that calls Cargo to generate the documentation and links to it rather than adding another tool like SWIG.

@LecrisUT
Copy link
Author

LecrisUT commented Mar 1, 2023

Swig is not a documentation tool, it's a tool to automatically generate bindings, like generating python api of the c library.

The documentation tool is readthedocs and it is incredibly mature. It is possible to call practically any documentation generation like doxygen and sphinx, so it will be possible to link it to cargo as well as long as we can configure the output destination. I don't see the documentation source though.

@seatonullberg
Copy link
Collaborator

Right now the raw bindings are generated with bindgen and are stored in the spglib-sys crate. The -sys naming scheme is the convention for raw bindings in the Rust community. The spglib crate is a more convenient wrapper around these generated bindings.

The documentation source is the doc comments in the source code. The procedure for writing and building documentation with Cargo is described here.

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

2 participants