-
Notifications
You must be signed in to change notification settings - Fork 116
Fix doc API of SpglibSpacegroupType #477
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM.
The order of struct is inconsequential, but it's good to resolve these as they are discovered.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #477 +/- ##
========================================
Coverage 83.80% 83.80%
========================================
Files 25 25
Lines 8164 8164
Branches 1705 1705
========================================
Hits 6842 6842
Misses 1322 1322
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I was trying to make a Julia wrapper around |
Oh, yeah you're right. I forgot about memory alignment and such, been doing too much coding in Python lately |
@Liozou Did you get in touch with @singularitti? They already have a Julia wrapper: https://spglib.readthedocs.io/en/latest/interface.html#julia-interface |
Ah yes you are absolutely right! I had started wrapping only the necessary parts in my code in 2020, before Spglib.jl was released, but I should probably switch to it now. |
@Liozou, it is better to assume that the order can be changed and that new member can be added though I am not sure if it is possible in C-julia interface. |
If you are only consuming it via However if you expose the bare struct (which I would not recommend because of potential memory leak issues) you do need the exact structure since it does an implicit |
Well, Julia requires the exact layout of the C struct in order to wrap it, much the same as you need it in Python here. You can have a look at the relevant definitions in Spglib.jl here and there. But to be clear, the re-ordering does not really matter for my application either! I am accessing the fields by their name anyway. What does matter is that the C struct and the Julia struct must be kept in sync.
|
Yes, but as you can see it is done by a C code so when it reads Of course there is an issue that the compiled libraries are not compatible and the dependencies would need to be re-compiled. That is usually caught by the packager's automation, e.g. Fedora caught a ABI incompatiblity and I am working on rebuilding.
We are trying to do that as much as possible. We have ABI checks within But about |
Hi @LecrisUT, I am not a skilled C expert but according to Julia's documentation:
It seems that we have to write the Julia May I ask which version is the Spglib C code affect by this change? I have not updated Spglib.jl to v2.3.0 since you changed some conventions. I plan to release a breaking change with major version update (say, Spglib.jl v1.0.0, etc.). However, I am very busy recently. @Liozou Would you like to help? Thank you! |
In fotran, with |
Very long ago (8 years maybe). Don't worry aboit it. There were other breaking changes in between.
That part I've sort of figured out. What I was curious this time is if Julia builds a static library of spglib, or does it always use a dynamic linkage, or both? How does Julia search for the library at build and runtime? |
@LecrisUT The way it works in Julia is the following: As a consequence, when a user decides to load the Julia package
@singularitti I'm always happy to help, although I am also limited in the time I can spend. The best way forward would probably be for you to open an issue in your repo with all the things you would like to see done for the next release, tag me, and I'll see what I can do! |
Ok, interesting, I do see some reference that spglib is loaded dynamically here and I do not see any reference of build scripts in
There shouldn't have been any breaking changes there, they should still be compatible. Most of the stuff is on the build system, fixes to some segmentation faults, control over the output messages and such. Let me know if you find any issues. |
Hello,
I just noticed that the documented C-API for
SpglibSpacegroupType
does not actually reflect the underlying C struct... This PR fixes that.For the
hall_symbol
-hall_number
switch, the documentation was added at the same time as the field in the wrong order in #176, two years ago.For the
pointgroup_international
-pointgroup_schoenflies
switch, I believe that comes from 3512320, that is eight years ago!The Python interface does not look affected, the keys are in the same order as the C struct.