Skip to content

Remove fmt: convert S-Z files to std::format (part 6)#11633

Merged
mitchute merged 9 commits into
developfrom
remove-fmt-part-6
Jun 12, 2026
Merged

Remove fmt: convert S-Z files to std::format (part 6)#11633
mitchute merged 9 commits into
developfrom
remove-fmt-part-6

Conversation

@brianlball

@brianlball brianlball commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Part 6 of the Remove-fmt campaign (drop vendored third_party/fmt for C++20 std::format). Converts the S-Z source files; sibling to part 4 (#11619, I*, merged) and part 5 (#11630, J-R, open). No file overlap with part 5.

Scope

36 files (S-Z basenames): 855 {:.NR} -> {:.Nf}, ~1040 EnergyPlus::format/fmt::format -> std::format. 0 residual {R} in these files.

Kept on original entry point (std::format cannot express)

  • 11 raw-enum args (no std::formatter) -> kept EnergyPlus::format: SurfaceGeometry x6 (CalculationMethod), WaterToAirHeatPumpSimple x2 (WAHPType), SteamBaseboardRadiator (EquipType), UnitarySystem (.type), ZoneTempPredictorCorrector (TempControlType).
  • 1 runtime/string-spec call ({:2.2F} on std::string, pre-existing) -> kept EnergyPlus::format (ScheduleManager).
  • 1 fmt::join -> kept fmt::format (ZoneTempPredictorCorrector).

Notable

  • Fixed one malformed spec {.0R} (missing colon) -> {:.0f} (WeatherManager) as part of the {R} removal.
  • Updated 2 unit-test expected strings where sub-0.1 values switch from {R} scientific to {:.Nf} fixed (SimAirServingZones, SimulationManager).
  • No {:#G} introduced (it is non-portable: 0.500000 MSVC/libstdc++ vs 0.50000 macOS libc++). All conversions are portable {:.Nf}/{:.NE}.

Label: Refactoring (matches parts 1-5).

@brianlball brianlball added the Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit c5dceb3

Regression Summary
  • EIO: 814
  • Table Small Diffs: 666
  • ERR: 104
  • Table Big Diffs: 13
  • PERF_LOG: 3
  • SCREEN: 2

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit c5dceb3

Regression Summary
  • EIO: 810
  • Table Small Diffs: 664
  • ERR: 104
  • Table Big Diffs: 13
  • PERF_LOG: 3
  • SCREEN: 2

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 9a5d950

Regression Summary
  • EIO: 814
  • Table Small Diffs: 666
  • ERR: 104
  • Table Big Diffs: 13
  • PERF_LOG: 3
  • SCREEN: 2

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 9a5d950

Regression Summary
  • EIO: 810
  • Table Small Diffs: 664
  • ERR: 104
  • Table Big Diffs: 13
  • PERF_LOG: 3
  • SCREEN: 2

@brianlball

brianlball commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Regression summary (run 27227192033, latest commit), display-only:

Bucket ubuntu-24.04 macos-14
Table Big Diffs 13 13
Table Small Diffs 666 664
EIO 814 810
ERR 104 104
PERF_LOG 3 3
SCREEN 2 2

One precision refinement: the Humidity Ratio at Peak field in Zone/Space Sizing Information is kept in scientific ({:.5E}) rather than fixed, and fixed would drop it to ~2 sig figs. It now matches the prior precision (1.02382E-03 vs old 1.02382E-003). Magnitude-spanning columns (air flows, etc.) stay fixed.

@brianlball brianlball requested a review from mitchute June 9, 2026 19:20
@jmarrec jmarrec force-pushed the remove-fmt-part-6 branch from 0ac80cb to b63d6f9 Compare June 11, 2026 19:12
@jmarrec

jmarrec commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I rebased on develop to resolve conflicts (after my fmt filesystem PR #11628) and force pushed, make sure to update your local ref if you do any more work.

@jmarrec

jmarrec commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I merged #11630 and this PR, remaining R-format specs in

HeatBalanceManager.cc
GroundHeatExchangers/Slinky.cc
AirflowNetwork/src/Solver.cpp
InternalHeatGains.cc

@github-actions

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit c06b3f4

Regression Summary
  • EIO: 815
  • Table Small Diffs: 666
  • ERR: 104
  • Table Big Diffs: 13
  • PERF_LOG: 3
  • SCREEN: 2

brianlball and others added 9 commits June 12, 2026 08:52
36 S-Z source files: 855 {:.NR}->{:.Nf}, ~1040 EnergyPlus::format/
fmt::format -> std::format. Type-incompatible calls kept on their
original entry point: 11 raw-enum args (no std::formatter) and 1
runtime/string-spec call on EnergyPlus::format; 1 fmt::join on
fmt::format. Fixed one malformed spec {.0R}->{:.0f} (WeatherManager).
Updated 2 unit-test expected strings for {:.NR}->{:.Nf} (sub-0.1
values: scientific -> fixed).
…sion

Humidity Ratio at Peak is always <0.1, so {:.5f} dropped it to ~2 sig
figs (e.g. 0.00061). {:.5E} restores the ~6 sig figs the prior {:.5R}
showed (E-04 vs old E-004, numerically identical). System Sizing has no
humidity field; spanning fields (air flows, schedules) stay {:.Nf}.
- InternalHeatGains: prints the diff of two temps only if greater than AutoVsHardSizingDeltaTempThreshold= 1.5C so .1f is good enough
- WindowManager: clearly just a formatting weirdness that explains why it wasn't caught
ref 8383052e3e695a8812d4431ee8e8b0747b72b876
@jmarrec jmarrec force-pushed the remove-fmt-part-6 branch from b63d6f9 to 281b8dc Compare June 12, 2026 10:08
@jmarrec

jmarrec commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@brianlball I'm hijacking your PR to add the last remaining potentially diff-producing changes that I encountered while I was actually completely removing fmt (PR is pending this one)

 src/EnergyPlus/AirflowNetwork/src/Solver.cpp         | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------
 src/EnergyPlus/InternalHeatGains.cc                  |   8 +++----
 src/EnergyPlus/WindowManager.cc                      |   8 +++----

I ran regressions between your commit (2476378) and the HEAD (281b8dc) and there are some minor EIO diffs in 4 files, so it's fine.

All 4 diffs involve AirflowNetwork Wind Pressure Coefficients tables, and all changes are formatting-only — no actual values changed:

  1. US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF, SingleFamilyHouse_HP_Slab, SingleFamilyHouse_HP_Slab_Dehumidification (identical diffs):
    - WPCTABLE5 row: values like -0.63 → -0.62 and -0.59 → -0.58. This is a rounding/precision difference (e.g., -0.625 rounding to -0.62 vs -0.63 depending on rounding mode), not a real physical change.
  2. AirflowNetworkAdvanced_SingleSided_NV:
    - Multiple WPC table rows (SSWPCTABLEFACADE1-4, SSWPCTABLE6, SSWPCTABLE7) show scientific-notation values reformatted to decimal notation: -8.06E-002 → -0.08, 5.80E-004 → 0.00, -8.72E-002 → -0.09,
    -6.65E-002/-6.87E-002 → -0.07. This is purely a number formatting change (scientific notation vs fixed decimal), with the small rounding noted above (e.g., -0.63→-0.62).

Bottom line: These are all cosmetic/formatting differences in how AirflowNetwork wind pressure coefficients are printed to the .eio file (rounding to 2 decimals and avoiding scientific notation for
small values) — not functional regressions.

-AirflowNetwork Model:Wind Pressure Coefficients, !WPCTABLE5, -0.73,-0.63,-0.54,-0.59,-0.54,-0.63,-0.73,-0.63,-0.54,-0.59,-0.54,-0.63
+AirflowNetwork Model:Wind Pressure Coefficients, !WPCTABLE5, -0.73,-0.62,-0.54,-0.58,-0.54,-0.62,-0.73,-0.62,-0.54,-0.58,-0.54,-0.62

and some minor stuff in tests: all test still pass

 tst/EnergyPlus/unit/Coils/CoilCoolingDX.unit.cc      |   4 ++--
 tst/EnergyPlus/unit/InternalHeatGains.unit.cc        |   8 +++----
 tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc     |   6 ++---
 tst/EnergyPlus/unit/OutputReportTabular.unit.cc      |   6 ++---
 tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc |   2 +-

@github-actions

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 0e57fb4

Regression Summary
  • EIO: 815
  • Table Small Diffs: 666
  • ERR: 104
  • Table Big Diffs: 13
  • PERF_LOG: 3
  • SCREEN: 2

@mitchute

Copy link
Copy Markdown
Collaborator

Thanks @brianlball and @jmarrec. This one is ready to go. We're still waiting on the macOS GHA run, but unfortunately, there's another project at NLR eating up all of the macOS runner quota. I've spot checked the results locally on my Mac. It builds and local regressions are consistent with the other ones posted online.

Merging.

@mitchute mitchute merged commit 1155a63 into develop Jun 12, 2026
11 of 13 checks passed
@mitchute mitchute deleted the remove-fmt-part-6 branch June 12, 2026 13:52
@github-actions

Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit c06b3f4

Regression Summary
  • EIO: 811
  • Table Small Diffs: 585
  • ERR: 105
  • Table Big Diffs: 92
  • PERF_LOG: 3
  • SCREEN: 2

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

Labels

Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants