Skip to content

boutpp cleanup#3318

Merged
dschwoerer merged 20 commits intonextfrom
misc
Mar 13, 2026
Merged

boutpp cleanup#3318
dschwoerer merged 20 commits intonextfrom
misc

Conversation

@dschwoerer
Copy link
Copy Markdown
Contributor

Mostly improvements to the boutpp python interface, and some minor other things.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

template <typename T>
inline T toFieldAligned(const T& f, const std::string& region = "RGN_ALL") {
static_assert(bout::utils::is_Field_v<T>, "toFieldAligned only works on Fields");
ASSERT3(f.getCoordinates() != nullptr);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "ASSERT3" is directly included [misc-include-cleaner]

  ASSERT3(f.getCoordinates() != nullptr);
  ^

@@ -68,7 +68,8 @@ public:
*/
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: function 'Field2D::Field2D' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
  ^
Additional context

src/field/field2d.cxx:41: the definition seen here

Field2D::Field2D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in,
         ^

include/bout/field2d.hxx:68: differing parameters are named here: ('region'), in definition: ('UNUSED_regionID')

  Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
  ^

Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
DirectionTypes directions_in = {YDirectionType::Standard,
ZDirectionType::Average});
ZDirectionType::Average},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "ZDirectionType" is directly included [misc-include-cleaner]

                                          ZDirectionType::Average},
                                          ^

DirectionTypes directions_in = {YDirectionType::Standard,
ZDirectionType::Average});
ZDirectionType::Average},
std::optional<size_t> region = {});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::optional" is directly included [misc-include-cleaner]

include/bout/field2d.hxx:27:

- class Field2D;
+ #include <optional>
+ class Field2D;

int yindex_in = -1,
DirectionTypes directions_in = {YDirectionType::Standard,
ZDirectionType::Standard});
ZDirectionType::Standard},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "ZDirectionType" is directly included [misc-include-cleaner]

                                            ZDirectionType::Standard},
                                            ^

Field3D::Field3D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in)
: Field(localmesh, location_in, directions_in) {
Field3D::Field3D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in,
std::optional<size_t> regionID)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::optional" is directly included [misc-include-cleaner]

src/field/field3d.cxx:35:

- #include <utility>
+ #include <optional>
+ #include <utility>


FieldPerp::FieldPerp(Mesh* localmesh, CELL_LOC location_in, int yindex_in,
DirectionTypes directions)
DirectionTypes directions, std::optional<size_t> UNUSED(regionID))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "DirectionTypes" is directly included [misc-include-cleaner]

                     DirectionTypes directions, std::optional<size_t> UNUSED(regionID))
                     ^


FieldPerp::FieldPerp(Mesh* localmesh, CELL_LOC location_in, int yindex_in,
DirectionTypes directions)
DirectionTypes directions, std::optional<size_t> UNUSED(regionID))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "UNUSED" is directly included [misc-include-cleaner]

src/field/fieldperp.cxx:25:

- #include <bout/boutcomm.hxx>
+ #include "bout/unused.hxx"
+ #include <bout/boutcomm.hxx>

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -68,7 +68,8 @@ public:
*/
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: function 'Field2D::Field2D' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

  Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
  ^
Additional context

src/field/field2d.cxx:43: the definition seen here

Field2D::Field2D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in,
         ^

include/bout/field2d.hxx:68: differing parameters are named here: ('region'), in definition: ('UNUSED_regionID')

  Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
  ^

ZedThree
ZedThree previously approved these changes Mar 12, 2026
@ZedThree
Copy link
Copy Markdown
Member

At some point we should look into using scikit-build-core to replace the custom backend

@dschwoerer dschwoerer merged commit 8397daa into next Mar 13, 2026
22 of 24 checks passed
@dschwoerer dschwoerer deleted the misc branch March 13, 2026 11:16
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.

2 participants