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

Remove and deprecate nfields #653

Merged
merged 1 commit into from
Apr 1, 2023
Merged

Remove and deprecate nfields #653

merged 1 commit into from
Apr 1, 2023

Conversation

termi-official
Copy link
Member

Closes #444 .

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2023

Codecov Report

Patch coverage: 71.42% and project coverage change: -0.01 ⚠️

Comparison is base (a917a24) 92.97% compared to head (4fb3b0f) 92.97%.

❗ Current head 4fb3b0f differs from pull request most recent head b7a79b7. Consider uploading reports for the commit b7a79b7 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #653      +/-   ##
==========================================
- Coverage   92.97%   92.97%   -0.01%     
==========================================
  Files          30       30              
  Lines        4500     4484      -16     
==========================================
- Hits         4184     4169      -15     
+ Misses        316      315       -1     
Impacted Files Coverage Δ
src/Dofs/DofRenumbering.jl 91.48% <ø> (ø)
src/Dofs/MixedDofHandler.jl 91.36% <0.00%> (-0.42%) ⬇️
src/Dofs/sparsity_pattern.jl 99.27% <ø> (ø)
src/Dofs/DofHandler.jl 84.23% <83.33%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@termi-official termi-official marked this pull request as ready for review March 29, 2023 12:37
@kimauth
Copy link
Member

kimauth commented Mar 31, 2023

I had been thinking if we should entirely remove nfields(dh). The only place it seems to be used is the soon-to-be-gone DofHandler.
The docstrings for renumbering and the sparsity pattern should probably point to getfieldnames(dh), as the order of the fields matters for them.

I have a hard time coming up with a use case where you'd only want to know the number of fields and nothing more. Usually you'd want to iterate over them and that's what getfieldnames(dh) should be used for I believe.

What do you think?

@fredrikekre
Copy link
Member

I was about to suggest the same.

@termi-official
Copy link
Member Author

Thanks for the feedback on this. I have no strong opinion here. Just thought that it might be a nice convenience function. But I can also remove it if that is what we want to do.

@fredrikekre
Copy link
Member

Looking at the small diff, it looks like we don't even use it much internally.

This patch deprecates the internal function `nfields(dh)` in favor of
`length(getfieldnames(dh))`. The reason is twofold: `nfields` where
barely used, not even internally, and `nfields` was easy to confuse with
the existing `Base.nfields` function that would still work, but behave
quite differently.

Closes #444.
@fredrikekre fredrikekre changed the title Rename and deprecate nfields Remove and deprecate nfields Apr 1, 2023
@fredrikekre fredrikekre merged commit 358e148 into master Apr 1, 2023
@fredrikekre fredrikekre deleted the do/rename-nfields branch April 1, 2023 09:17
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

Successfully merging this pull request may close these issues.

Ferrite.nfields should be called differently
4 participants