Skip to content

Conversation

atztogo
Copy link
Collaborator

@atztogo atztogo commented Jan 14, 2023

Update of Fortran wrapper.
Because I applied fprettify to spglib_f08.f90, the most of lines were changed. However the real change is found at ac6a4fb.

Doxygen comment of spn_get_operations_with_site_tensors in spin.c is moved to that in spin.h.

@codecov-commenter
Copy link

Codecov Report

Base: 64.00% // Head: 64.00% // No change to project coverage 👍

Coverage data is based on head (b03d318) compared to base (fb55b8f).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #216   +/-   ##
========================================
  Coverage    64.00%   64.00%           
========================================
  Files           18       18           
  Lines         1328     1328           
========================================
  Hits           850      850           
  Misses         478      478           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@atztogo atztogo requested a review from lan496 January 14, 2023 13:54
@atztogo
Copy link
Collaborator Author

atztogo commented Jan 14, 2023

No test though...

Copy link
Member

@lan496 lan496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With my little Fortran experience, I am not qualified to review this PR......
At least the new inputs with_time_reversal and is_axial seem to be correctly added.

@atztogo
Copy link
Collaborator Author

atztogo commented Jan 14, 2023

Thanks, thanks.

@atztogo atztogo merged commit 6b4332c into spglib:develop Jan 14, 2023
@atztogo atztogo deleted the fortran-spg_get_symmetry_with_site_tensors branch January 14, 2023 14:14
@LecrisUT
Copy link
Collaborator

LecrisUT commented Jan 14, 2023

Sorry i didn't catch it in time, but you should make aliases of the functions and deprecate them when you change the api like that.

Probably there's a similar issue with the C part we should check (more familiar with deprecating on C side tbh). Thankfully you can map it to a different function with bind(c, name=function_name_old) if necessary. Although when deprecating, we should do the other way around.

@atztogo
Copy link
Collaborator Author

atztogo commented Jan 14, 2023

Thanks @LecrisUT for your comment. Fortran support of spglib is fairly weak. I'm not familiar with it but no maintainer. This PR is a fix of the fortran wrapper. This function in C was changed at v2 from v1, but the fortran wrapper was not updated following the change.

I'm not also good at those stuff like deprecating manner. Could you tell me a little bit more in detail? I also have to make the fortran wrapper of new functions made at v2. So your information is helpful.

@LecrisUT
Copy link
Collaborator

I didn't know this was part of the major release change. In that case I think it would be fine.

Normally, especially between minor version changes, when you need to change an api function you would:

  • Create a new function, preferably with a different name
    • Should avoid names like function_new because that will become confusing quick after more updates
    • If possible separate namespaces/header files by version, e.g. spglib/v1/spglib.h
  • Mark old function as deprecated with [[deprecated]]
    • Unfortunately plain C only has this feature in C23, while C++ had it since C++14. So for the time, it should be sandwiched by #ifdef to check for C++ or C23. For the developers using older compilers, there is little we can do.
    • Internally call the new function with reasonable default values
    • Allow for 1-2 minor versions before removing in a major release change. You could also remove the old apis after a few minor version changes
  • If possible, or if there is a major functionality change, keep the old function name with [[deprecated]] and mark the function as deleted (e.g. void foo(int x) = delete)
  • Document the change in API with an appropriate migration path if there's a major release change. Ideally you would have these documented between minor releases and simply link to them at major change
  • If possible keep the online api documentation for all the minor versions

Of course, you can have various variants on these depending on the specific change made

Since the original project was not setup with these in mind it is ok for the v2 major version change to be a bit more loose while converging to flow you feel more comfortable.

@atztogo
Copy link
Collaborator Author

atztogo commented Jan 15, 2023

Thanks @LecrisUT for your detailed information. It may be difficult to follow the ideal way, but we will try to do the best.

@LecrisUT LecrisUT added the breaking-changes Changes that are incompatible with previous release label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-changes Changes that are incompatible with previous release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants