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 most deprecated declarations #2291

Merged
merged 21 commits into from
Jul 27, 2022
Merged

Remove most deprecated declarations #2291

merged 21 commits into from
Jul 27, 2022

Conversation

ZedThree
Copy link
Member

@ZedThree ZedThree commented Apr 20, 2021

I'm reasonably certain everything removed here is marked deprecated in v4.4, but it's plausible there's something I've missed that should be deprecated there first.

There's a small number of things that are still in use and so can't be removed yet:

  • FieldGenerator::generate(BoutReal x, BoutReal y, BoutReal z, BoutReal t): this basically needs the boundary conditions rewrite before we can remove this, which is upsetting
  • Mesh::UpXSplitIndex/DownXSplitIndex: used in the unit tests for the fake parallel mesh. Could be removed from Mesh and made a protected method of BoutMesh I don't know why I thought we needed to keep this, it's gone!
  • lowpass: we changed the keep_zonal argument from int to bool. Unfortunately, ints are implicitly convertable to bools, and the int version, while deprecated, does ASSERT0 that only 0s or 1s are passed. A better solution might be to use an enum to strongly type the argument:
enum class LowPassZonal { keep, remove };

Field3D lowPass(const Field3D& var, int zmax, LowPassZonal zonal) { ... }

lowPass(f, 5, LowPassZonal::keep);

@ZedThree ZedThree added this to the BOUT-5.0 milestone Apr 20, 2021
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

ZedThree and others added 6 commits July 22, 2022 11:20
* next: (1828 commits)
  Use MPI_COMM_NULL rather than nullptr
  Apply clang-format changes
  Apply clang-format changes
  Don't compile LaplaceXY2 with 3D metrics
  Apply clang-format changes
  Apply clang-format changes
  Laplacexy2 modifications
  Apply clang-format changes
  Apply clang-format changes
  nvcc needs toString(HYPRE_SOLVER_TYPE)
  nvcc now seems to need the factory flags
  Update fmt to latest version
  Apply clang-format changes
  Output BoutException.what() in PhysicsModel main()
  use hasParallelSlices
  Apply clang-format changes
  Only destroy if it exists
  Backgrounds don't work with parallel BCs
  Ensure that parallel slices exist
  CI: Remove unused stage from clang-tidy-review job
  ...
* next:
  Apply clang-format
  CI: Don't update submodules (already updated)
  CI: Workaround for git ownership checks in container
  CI: Bump actions/checkout version
  CI: Use latest version of cmake in clang-tidy-review
  Add 'u' format flag to BOUT.settings output
  Adds a 'u' format, commenting unused options
  Print wether an option was marked as conditionally used
`vecops.hxx` requires `Field/Vector` headers to be used, so may as
well always include them
Copy link
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

@@ -225,17 +225,13 @@ public:
// return the appropriate index. Some corners cells are actually
// sent along with the rest of the edge. This can be predicted
// based on teh value of xy[In|Out][Up|Down]Mesh_SendsInner.
if (mesh->yUpMesh && wait_any_count < 0 && mesh->communicatingY &&
mesh->UpXSplitIndex() > 0) {
if (mesh->yUpMesh && wait_any_count < 0 && mesh->communicatingY) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'FakeParallelMesh *' -> bool [readability-implicit-bool-conversion]

Suggested change
if (mesh->yUpMesh && wait_any_count < 0 && mesh->communicatingY) {
if ((mesh->yUpMesh != nullptr) && wait_any_count < 0 && mesh->communicatingY) {

*indx = wait_any_count = 0;
} else if (mesh->yDownMesh && wait_any_count < 1 && mesh->communicatingY &&
mesh->UpXSplitIndex() == 0) {
} else if (mesh->yDownMesh && wait_any_count < 1 && mesh->communicatingY) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'FakeParallelMesh *' -> bool [readability-implicit-bool-conversion]

Suggested change
} else if (mesh->yDownMesh && wait_any_count < 1 && mesh->communicatingY) {
} else if ((mesh->yDownMesh != nullptr) && wait_any_count < 1 && mesh->communicatingY) {

*indx = wait_any_count = 1;
} else if (mesh->yDownMesh && wait_any_count < 2 && mesh->communicatingY &&
mesh->DownXSplitIndex() > 0) {
} else if (mesh->yDownMesh && wait_any_count < 2 && mesh->communicatingY) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'FakeParallelMesh *' -> bool [readability-implicit-bool-conversion]

Suggested change
} else if (mesh->yDownMesh && wait_any_count < 2 && mesh->communicatingY) {
} else if ((mesh->yDownMesh != nullptr) && wait_any_count < 2 && mesh->communicatingY) {

*indx = wait_any_count = 2;
} else if (mesh->yDownMesh && wait_any_count < 3 && mesh->communicatingY &&
mesh->DownXSplitIndex() == 0) {
} else if (mesh->yDownMesh && wait_any_count < 3 && mesh->communicatingY) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'FakeParallelMesh *' -> bool [readability-implicit-bool-conversion]

Suggested change
} else if (mesh->yDownMesh && wait_any_count < 3 && mesh->communicatingY) {
} else if ((mesh->yDownMesh != nullptr) && wait_any_count < 3 && mesh->communicatingY) {

@ZedThree ZedThree merged commit 382e939 into next Jul 27, 2022
@ZedThree ZedThree deleted the remove-deprecated-decls branch July 27, 2022 07:43
ZedThree added a commit that referenced this pull request Jul 28, 2022
Fixes #2543

Was deprecated in #448, and `Field3D.setBackground` was removed in #2291.
This removes the private member and all uses of it
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.

None yet

2 participants