Skip to content

Update all template formatting - #505

Open
PhilipFackler wants to merge 3 commits into
developfrom
PhilipFackler/template-formatting
Open

Update all template formatting#505
PhilipFackler wants to merge 3 commits into
developfrom
PhilipFackler/template-formatting

Conversation

@PhilipFackler

Copy link
Copy Markdown
Collaborator

Description

Update templates everywhere to use new style guidelines

Closes #366

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • [N/A] There are unit tests for the new code.
  • [N/A] The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • [N/A] I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/template-formatting branch 2 times, most recently from 25b463f to 29d6d5d Compare July 22, 2026 19:50
@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/template-formatting branch 3 times, most recently from d3fa387 to 45cf5d5 Compare July 23, 2026 19:44
@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/template-formatting branch from 45cf5d5 to 618fb79 Compare July 23, 2026 20:01

@pelesh pelesh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some preliminary comments:

  • This PR changes the scope of scalar type aliases from private to public. This leads to an unintuitive code like void function<scalar_type>(ScalarT x);.
  • There is minor scope creep as type aliases other than scalar types were handled in a similar way. What is the motivation for that?

Comment on lines 20 to +23
public:
using RealT = GridKit::ScalarTraits<ScalarT>::RealT;
using ScalarT = scalar_type;
using IdxT = index_type;
using RealT = GridKit::ScalarTraits<ScalarT>::RealT;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are these public? Shouldn't these be private as they are intended for use inside the class?

Comment on lines +684 to +685
template <typename real_type, typename IdxT>
int CsrMatrix<real_type, IdxT>::allocateMatrixData(memory::MemorySpace memspace)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe this was an omission:

Suggested change
template <typename real_type, typename IdxT>
int CsrMatrix<real_type, IdxT>::allocateMatrixData(memory::MemorySpace memspace)
template <typename real_type, typename index_type>
int CsrMatrix<real_type, IdxT>::allocateMatrixData(memory::MemorySpace memspace)

Comment on lines -29 to +38
* @tparam Policy - Memory management policy (vendor specific)
* @tparam policy - Memory management policy (vendor specific)
*
* @author Slaven Peles <peless@ornl.gov>
*/
template <class Policy>
template <typename policy>
class MemoryUtils
{
public:
using Policy = policy;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why this change?

Comment on lines 38 to +49

/// Parameters enum
using Parameters = parameters_type;
/// Buses enum
using Buses = buses_type;
/// Signal inputs enum
using SignalInputs = signal_inputs_type;
/// Signal outputs enum
using SignalOutputs = signal_outputs_type;
/// Monitorable variables enum
using MonitorableVariables = monitorable_variables_type;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is this necessary? I thought the issue was with scalar types?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use different style for template parameters and public interface types

2 participants