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

Refactor entry string to tensor functions #1186

Merged
merged 6 commits into from
Jul 5, 2024

Conversation

AmishgaAlphonius
Copy link
Collaborator

@AmishgaAlphonius AmishgaAlphonius commented Jul 4, 2024

Description

The entry_string_to_tensor functions were duplicated; they were in utilities.h and parameters.h. In one case it was templated with spacedim and the other not. This PR merges both uses of the same function in utilities.h. Since these are small functions, they were inlined. Hence, they don't have any explicit instantiation.

While doing this, redundant if conditions were noticed in the manifolds.cc, these were replaced by for loops.

Checklist (will be removed when merged)

See this page for more information about the pull request process.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Lethe documentation is up to date
  • The branch is rebased onto master
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent
  • If parameters are modified, the tests and the documentation of examples are up to date
  • Changelog (CHANGELOG.md) is up to date if the refactor affects the user experience or the codebase

Pull request related list:

  • No other PR is open related to this refactoring
  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If any future works is planed, an issue is opened
  • The PR description is cleaned and ready for merge

@AmishgaAlphonius AmishgaAlphonius added Ready for review Refactoring This PR is only refactoring or clean up labels Jul 4, 2024
@AmishgaAlphonius AmishgaAlphonius self-assigned this Jul 4, 2024
Copy link
Collaborator

@oguevremont oguevremont left a comment

Choose a reason for hiding this comment

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

It's clear!

include/core/utilities.h Show resolved Hide resolved
include/core/utilities.h Show resolved Hide resolved
include/core/utilities.h Show resolved Hide resolved
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for the nice refactor.

@blaisb blaisb merged commit cc08ca7 into master Jul 5, 2024
8 checks passed
@blaisb blaisb deleted the refactor-entry-string-to-tensor branch July 5, 2024 13:05
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description
The entry_string_to_tensor functions were duplicated; they were in utilities.h and parameters.h. In one case it was templated with spacedim and the other not. This PR merges both uses of the same function in utilities.h. Since these are small functions, they were inlined. Hence, they don't have any explicit instantiation.

While doing this, redundant if conditions were noticed in the manifolds.cc, these were replaced by a for loop.

Former-commit-id: cc08ca7
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description
The entry_string_to_tensor functions were duplicated; they were in utilities.h and parameters.h. In one case it was templated with spacedim and the other not. This PR merges both uses of the same function in utilities.h. Since these are small functions, they were inlined. Hence, they don't have any explicit instantiation.

While doing this, redundant if conditions were noticed in the manifolds.cc, these were replaced by a for loop.

Former-commit-id: cc08ca7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for review Refactoring This PR is only refactoring or clean up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants