From 1e7eb65eb6fa13afc8dc036c5b7d0eba9b970957 Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Wed, 4 Sep 2024 15:01:12 -0600 Subject: [PATCH] update clang format action version to avoid distutils issue (#525) * update clang format action version to avoid distutils issue * clang format to 18 * more files updated for clang-format to version 18 --- .github/workflows/ci.yml | 4 +-- Source/Radiation/POneSingle.H | 2 +- Source/Radiation/POneSingleEB.H | 2 +- Source/Reactions/ReactorCvodeUtils.H | 4 +-- Source/Spray/BreakupSplash/ReitzKHRT.H | 2 +- Source/Spray/BreakupSplash/TABBreakup.H | 2 +- Source/Spray/SprayInjection.H | 2 +- Source/Spray/SprayParticles.cpp | 4 +-- Source/Transport/TransportParams.H | 26 +++++++++---------- .../Utility/Diagnostics/DiagConditional.cpp | 12 +++------ Source/Utility/Diagnostics/DiagPDF.cpp | 3 +-- Support/ceptr/pyproject.toml | 2 +- 12 files changed, 30 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caefa1aa7..71ad896b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,12 +18,12 @@ jobs: - name: Clone uses: actions/checkout@v4 - name: Check formatting - uses: DoozyX/clang-format-lint-action@v0.16.2 + uses: DoozyX/clang-format-lint-action@v0.18.2 with: source: './Source ./Testing ./Mechanisms' exclude: '.' extensions: 'H,h,cpp' - clangFormatVersion: 16 + clangFormatVersion: 18 Codespell: needs: Formatting diff --git a/Source/Radiation/POneSingle.H b/Source/Radiation/POneSingle.H index 0197fa885..f7118831f 100644 --- a/Source/Radiation/POneSingle.H +++ b/Source/Radiation/POneSingle.H @@ -56,7 +56,7 @@ public: bcoef_(bcoef), robin_a_(robin_a), robin_b_(robin_b), - robin_f_(robin_f){}; + robin_f_(robin_f) {}; void solve() { diff --git a/Source/Radiation/POneSingleEB.H b/Source/Radiation/POneSingleEB.H index 938b668d7..ef256ae2d 100644 --- a/Source/Radiation/POneSingleEB.H +++ b/Source/Radiation/POneSingleEB.H @@ -62,7 +62,7 @@ public: bcoef_(bcoef), robin_a_(robin_a), robin_b_(robin_b), - robin_f_(robin_f){}; + robin_f_(robin_f) {}; void solve() { diff --git a/Source/Reactions/ReactorCvodeUtils.H b/Source/Reactions/ReactorCvodeUtils.H index 9a1614945..8e277b33a 100644 --- a/Source/Reactions/ReactorCvodeUtils.H +++ b/Source/Reactions/ReactorCvodeUtils.H @@ -269,7 +269,7 @@ fKernelComputeAJchem( amrex::Real temp_pt = u_curr[NUM_SPECIES]; const int consP = reactor_type == ReactorTypes::h_reactor_type; - amrex::GpuArray Jmat_pt = {0.0}; + amrex::GpuArray Jmat_pt = {0.0}; auto eos = pele::physics::PhysicsType::eos(); eos.RTY2JAC(rho_pt, temp_pt, massfrac.arr, Jmat_pt.arr, consP); @@ -318,7 +318,7 @@ fKernelDenseAJchem( amrex::Real temp_pt = u_curr[NUM_SPECIES]; const int consP = reactor_type == ReactorTypes::h_reactor_type; - amrex::GpuArray Jmat_pt = {0.0}; + amrex::GpuArray Jmat_pt = {0.0}; auto eos = pele::physics::PhysicsType::eos(); eos.RTY2JAC(rho_pt, temp_pt, massfrac.arr, Jmat_pt.arr, consP); diff --git a/Source/Spray/BreakupSplash/ReitzKHRT.H b/Source/Spray/BreakupSplash/ReitzKHRT.H index f324c07f1..48d0e8e4b 100644 --- a/Source/Spray/BreakupSplash/ReitzKHRT.H +++ b/Source/Spray/BreakupSplash/ReitzKHRT.H @@ -169,7 +169,7 @@ updateBreakupKHRT( rad_part = rp; num_dens = np; } // if (rs < rad_part && We_g > We_crit)... - } // if (!breakupRT)... + } // if (!breakupRT)... p.rdata(SprayComps::pstateDia) = 2. * rad_part; p.rdata(SprayComps::pstateNumDens) = num_dens; p.rdata(SprayComps::pstateN0) = N0; diff --git a/Source/Spray/BreakupSplash/TABBreakup.H b/Source/Spray/BreakupSplash/TABBreakup.H index c30829a2d..1e1416bc5 100644 --- a/Source/Spray/BreakupSplash/TABBreakup.H +++ b/Source/Spray/BreakupSplash/TABBreakup.H @@ -170,7 +170,7 @@ updateBreakupTAB( yn = ynp; ydotn = ydotnp; } // if (tbv < subdt) - } // if (Wer + A <= 1) + } // if (Wer + A <= 1) if (curt + subdt > dt) { subdt = dt - curt; } diff --git a/Source/Spray/SprayInjection.H b/Source/Spray/SprayInjection.H index aeb2cb6dd..da85a9958 100644 --- a/Source/Spray/SprayInjection.H +++ b/Source/Spray/SprayInjection.H @@ -296,7 +296,7 @@ SprayParticleContainer::uniformSprayInit( nparticles.pop_back(); } } // if (which == MyProc) - } // for (int which ... + } // for (int which ... for (auto& kv : host_particles) { auto grid = kv.first.first; auto tile = kv.first.second; diff --git a/Source/Spray/SprayParticles.cpp b/Source/Spray/SprayParticles.cpp index d5f57527a..9859467ec 100644 --- a/Source/Spray/SprayParticles.cpp +++ b/Source/Spray/SprayParticles.cpp @@ -480,8 +480,8 @@ SprayParticleContainer::updateParticles( p.id() = -1; } } // End of subcycle loop - } // End of p.id() > 0 check - }); // End of loop over particles + } // End of p.id() > 0 check + }); // End of loop over particles if (make_new_drops) { Gpu::copy( Gpu::deviceToHost, N_SB_d.begin(), N_SB_d.end(), N_SB_h.begin()); diff --git a/Source/Transport/TransportParams.H b/Source/Transport/TransportParams.H index b2de4d77e..d1342413f 100644 --- a/Source/Transport/TransportParams.H +++ b/Source/Transport/TransportParams.H @@ -60,14 +60,14 @@ struct TransParm amrex::GpuArray dip = {0.0}; amrex::GpuArray pol = {0.0}; amrex::GpuArray zrot = {0.0}; - amrex::GpuArray fitmu = {0.0}; - amrex::GpuArray fitlam = {0.0}; - amrex::GpuArray fitdbin = { + amrex::GpuArray fitmu = {0.0}; + amrex::GpuArray fitlam = {0.0}; + amrex::GpuArray fitdbin = { 0.0}; bool use_soret = false; int numLite = 3; amrex::GpuArray liteSpec = {0}; - amrex::GpuArray fittdrat = {0.0}; + amrex::GpuArray fittdrat = {0.0}; amrex::GpuArray nlin = {0}; }; @@ -82,22 +82,22 @@ struct TransParm amrex::GpuArray pol = {0.0}; amrex::GpuArray zrot = {0.0}; - amrex::GpuArray fitmu = {0.0}; - amrex::GpuArray fitlam = {0.0}; - amrex::GpuArray fitdbin = { + amrex::GpuArray fitmu = {0.0}; + amrex::GpuArray fitlam = {0.0}; + amrex::GpuArray fitdbin = { 0.0}; bool use_soret = false; int numLite = 10; amrex::GpuArray liteSpec = {0}; - amrex::GpuArray fittdrat = {0.0}; + amrex::GpuArray fittdrat = {0.0}; amrex::GpuArray nlin = {0}; amrex::GpuArray Afac = {0.0}; amrex::GpuArray Bfac = {0.0}; - amrex::GpuArray sqrtT2ij = {0.0}; - amrex::GpuArray sqrtEpsilonij = {0.0}; - amrex::GpuArray sqrtMWij = {0.0}; - amrex::GpuArray sqrtKappaij = {0.0}; - amrex::GpuArray + amrex::GpuArray sqrtT2ij = {0.0}; + amrex::GpuArray sqrtEpsilonij = {0.0}; + amrex::GpuArray sqrtMWij = {0.0}; + amrex::GpuArray sqrtKappaij = {0.0}; + amrex::GpuArray Upsilonijk = {0.0}; amrex::GpuArray Kappai = {0.0}; amrex::GpuArray omega = {0.0}; diff --git a/Source/Utility/Diagnostics/DiagConditional.cpp b/Source/Utility/Diagnostics/DiagConditional.cpp index ab14fdd6e..060d2a5be 100644 --- a/Source/Utility/Diagnostics/DiagConditional.cpp +++ b/Source/Utility/Diagnostics/DiagConditional.cpp @@ -340,13 +340,11 @@ DiagConditional::writeAverageDataToFile( widths[3 + 2 * f] = std::max(width, static_cast(m_fieldNames[f].length()) + 5); condFile << std::left << std::setw(widths[3 + 2 * f]) - << m_fieldNames[f] + "_Avg" - << " "; + << m_fieldNames[f] + "_Avg" << " "; widths[4 + 2 * f] = std::max(width, static_cast(m_fieldNames[f].length()) + 7); condFile << std::left << std::setw(widths[4 + 2 * f]) - << m_fieldNames[f] + "_StdDev" - << " "; + << m_fieldNames[f] + "_StdDev" << " "; } condFile << "\n"; @@ -408,8 +406,7 @@ DiagConditional::writeIntegralDataToFile( widths[1 + f] = std::max(width, static_cast(m_fieldNames[f].length()) + 5); condFile << std::left << std::setw(widths[1 + f]) - << m_fieldNames[f] + "_Int" - << " "; + << m_fieldNames[f] + "_Int" << " "; } condFile << "\n"; @@ -459,8 +456,7 @@ DiagConditional::writeSumDataToFile( widths[1 + f] = std::max(width, static_cast(m_fieldNames[f].length()) + 5); condFile << std::left << std::setw(widths[1 + f]) - << m_fieldNames[f] + "_Sum" - << " "; + << m_fieldNames[f] + "_Sum" << " "; } condFile << "\n"; diff --git a/Source/Utility/Diagnostics/DiagPDF.cpp b/Source/Utility/Diagnostics/DiagPDF.cpp index ef9ce523c..727df3b64 100644 --- a/Source/Utility/Diagnostics/DiagPDF.cpp +++ b/Source/Utility/Diagnostics/DiagPDF.cpp @@ -210,8 +210,7 @@ DiagPDF::writePDFToFile( widths[0] = std::max(width, static_cast(m_fieldName.length()) + 1); widths[1] = std::max(width, static_cast(m_fieldName.length()) + 5); pdfFile << std::setw(widths[0]) << m_fieldName << " " - << std::setw(widths[1]) << m_fieldName + "_PDF" - << "\n"; + << std::setw(widths[1]) << m_fieldName + "_PDF" << "\n"; for (int i{0}; i < a_pdf.size(); ++i) { pdfFile << std::setw(widths[0]) << std::setprecision(prec) diff --git a/Support/ceptr/pyproject.toml b/Support/ceptr/pyproject.toml index d8368eb0b..185587f73 100644 --- a/Support/ceptr/pyproject.toml +++ b/Support/ceptr/pyproject.toml @@ -30,7 +30,7 @@ pep8-naming = "^0.12.1" flake8-docstrings = "^1.7.0" flake8-use-fstring = "^1.4" flynt = "^0.77" -clang-format = "==17.0.6" +clang-format = "==18.1.8" [build-system] requires = ["poetry-core>=1.0.0"]