Skip to content

Refactor debug-warning rules#293

Merged
lan496 merged 8 commits intospglib:developfrom
LecrisUT:debug-warnings
Jun 20, 2023
Merged

Refactor debug-warning rules#293
lan496 merged 8 commits intospglib:developfrom
LecrisUT:debug-warnings

Conversation

@LecrisUT
Copy link
Copy Markdown
Collaborator

  • Separated the rules to be independent of each other and made advanced variables to control their settings
  • Made the macro definition PRIVATE because they only affect the library compilation and not spglib.h
  • Simplified various debug statements since most of them are optimized by compiler when empty. Good coding practices these days is to avoid #ifdef and macros as much as possible.
  • @atztogo you have copyright of niggli.c and it said to be part of a different project, so I have to ask your approval for 32bae2b. Generally I avoid including code from project to project and then editing it, and when I do copy around and have full copyright, I tend to remove and migrate the copyright to avoid such confusions
  • What's the deal with c2efc49? Those functions are not used anywhere. Is it for future implementation, in which case it should be moved to a separate file, and be marked for experimental builds

@LecrisUT LecrisUT requested a review from atztogo June 15, 2023 11:25
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 15, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.64%. Comparing base (4cc2dbb) to head (9acefd4).
⚠️ Report is 487 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #293      +/-   ##
===========================================
- Coverage    86.07%   83.64%   -2.43%     
===========================================
  Files           23       23              
  Lines         6069     6274     +205     
===========================================
+ Hits          5224     5248      +24     
- Misses         845     1026     +181     
Flag Coverage Δ
c_api 74.01% <ø> (-2.48%) ⬇️
fortran_api 36.23% <ø> (-1.23%) ⬇️
python_api 80.42% <ø> (-2.41%) ⬇️
unit_tests 74.01% <ø> (-2.48%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Jun 15, 2023

  • @atztogo you have copyright of niggli.c and it said to be part of a different project, so I have to ask your approval for [32bae2b]. Generally I avoid including code from project to project and then editing it, and when I do copy around and have full copyright, I tend to remove and migrate the copyright to avoid such confusions

It's perfectly no problem. My aim was to make it a stand alone routine. I should do like you wrote. We can migrate the copyright.

@LecrisUT
Copy link
Copy Markdown
Collaborator Author

Thanks for the clarification. I should leave that commit to you. You can simply pull my branch and push directly to it.

@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Jun 15, 2023

What's the deal with c2efc49? Those functions are not used anywhere. Is it for future implementation, in which case it should be moved to a separate file, and be marked for experimental builds

If it is who I wrote, I think it can be removed.

@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Jun 15, 2023

Thanks for the clarification. I should leave that commit to you. You can simply pull my branch and push directly to it.

Sorry for bothering you. How can I do it concretely?

@LecrisUT
Copy link
Copy Markdown
Collaborator Author

What's the deal with c2efc49? Those functions are not used anywhere. Is it for future implementation, in which case it should be moved to a separate file, and be marked for experimental builds

If it is who I wrote, I think it can be removed.

It goes all the way back to "First commit on github" 10 year ago:

Sorry for bothering you. How can I do it concretely?

No problem at all:

Assuming you push using ssh, otherwise change it to https
$ git remote add LecrisUT [email protected]:LecrisUT/spglib.git
$ git fetch LecrisUT
$ git checkout LecrisUT/debug-warnings
Edit to your heart's content
$ vi src/niggli.c
Then do the usual
$ git commit -s
Now just specify my remote instead of origin
$ git push LecrisUT

@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Jun 15, 2023

It goes all the way back to "First commit on github" 10 year ago:

Then, it's definitely me. Let's remove it. Spglib was born in Aachen more than 10 years ago.

Thanks for your instruction about git.

@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Jun 19, 2023

@LecrisUT, thanks for all of these improvements.

@LecrisUT
Copy link
Copy Markdown
Collaborator Author

Actually I was looking at the debug in the tests and I find the debug messages too spamy to be useful to navigate so I want to get your opinion about it (not for this PR). Have you used the breakpoint debugger in VSCode? Do you find it more useful than the manual printing? I find that the usage of all of the debug_print and warning_print are equivalent with what you achieve with breakpoint debugger, and if these can be eliminated in favor of the latter, it will make debugging of the test cases much more manageable.

@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Jun 19, 2023

Of course I am happy to move to the modern world!

@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Jun 19, 2023

When I started to learn C, google didn't exist.

@LecrisUT
Copy link
Copy Markdown
Collaborator Author

Great, just wanted to make sure if it's not part of a developer's active setup, and if it is, if they need some help setting up the IDE debugger to work around it. I will leave it to @lan496 to merge this one after he's caught up with the discussion.

LecrisUT and others added 8 commits June 19, 2023 15:53
Signed-off-by: Cristian Le <[email protected]>
- Also do not propagate the definition flags

Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
These are optimized out by the compiler, no need for #ifdef guards

Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
Copy link
Copy Markdown
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.

LGTM!

@lan496 lan496 merged commit 8e426ac into spglib:develop Jun 20, 2023
@LecrisUT LecrisUT deleted the debug-warnings branch June 20, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants