Skip to content

fix(analytical): keep fractional SpaceSimulationResult UnmetHours (F-S11-2) - #219

Merged
michaldengusiak merged 3 commits into
sow/2026-Q4from
fix/s11-fractional-unmet-hours
Oct 24, 2026
Merged

michaldengusiak merged 3 commits into
sow/2026-Q4from
fix/s11-fractional-unmet-hours

Conversation

@michaldengusiak

@michaldengusiak michaldengusiak commented Oct 24, 2026 •

Copy link
Copy Markdown

F-S11-2: keep fractional SpaceSimulationResult unmet hours

Owner-approved for Ready and merge (2026-10-24) at exact head db48598b30cf2711af40a96cb55bbe6c5e5fb713. The independent review accepted tested content 47cc5dd8 and reviewed the later documentation-only commits through db48598b. The owner deferred Revit compatibility and kept the documented NaN behaviour. Record: documentation/S11-FractionalUnmetHours-PR.md.

Change

SpaceSimulationResultParameter.UnmetHours: IntegerParameterValue(0, 8760) → DoubleParameterValue(0, 8760). Same member, ordinal (34), key "Unmet Hours", range and JSON model. OccupiedUnmetHours, OccupiedHours, UnmetHourFirstIndex and the adjacency-cluster UnmetHours stay integer.

Before the change, SetValue converted with Convert.ToInt32, which rounds half to even: 0.25 → 0, 14.5 → 14, 14.75 → 15. It also accepted −0.25 and 8760.25.

Compatibility

  • Values are stored untyped, so integer JSON in old files ("Value": 9) still loads as Int32. It reads back as 9 through both TryGetValue<double> and TryGetValue<int>.
  • Tas whole-hour int counts are stored as the same-valued double (292.0).
  • Every reader in OpenStudio, Tas, B1a and the S10/S11 harnesses already reads the value as a double or as any number.
  • Nothing reads this parameter as int.
  • Saved files are not rewritten. Values rounded before this fix cannot be recovered.

Validation (local)

Check Result
New SpaceSimulationResultUnmetHoursTests on base metadata 8 fail / 4 pass
Same tests at 47cc5dd8 12/12 pass
Full SAM.Tests 3738/3738 pass
OpenStudio synthetic SQL 14.5 h / 14.75 h → SAM (engine-free probe) base: 14 / 15
fixed: 14.5 / 14.75, also after JSON save/reload
SAM_OpenStudio Q4 tests (TestCategory!=Simulation) against fixed SAM 488 pass, 2 fixture skips
SAM_OpenStudio B1a tests 51/51
SAM_Tas benchmark tests 40/40
SAM_Tas ReadBack tests 249/249
Real S10 acc2 saved models, base vs fixed SAM identical (9 / 292 / 0 / 40 / 0 / 0 h)
matches accepted subject/B1a
fixtures unchanged
  • No EnergyPlus, OpenStudio CLI or Tas run, and no Grasshopper deployment (APPDATA redirected).
  • S10 results-subject was not regenerated, because it reopens the TSD through Tas COM.
  • One stopped test run was started without the Simulation filter. It never reached the engine; the record has the details.

Owner decisions

  1. SAM_Revit export: DEFERRED by the owner (2026-10-24). Revit is unavailable and its shared-parameter definitions can be changed later, so there is no Revit fix now and SAM keeps fractional unmet hours. Background, unverified: SetValue_Integer refuses double. If the Revit parameters SAM_UnmetHoursCooling/Heating are Integer-typed, newly set values would stop being written to Revit. Their type comes from an external workbook. A possible later SAM_Revit change or a shared-parameter type change is not authorised now.
  2. NaN: owner keeps the documented behaviour (2026-10-24). SetValue(NaN) used to throw OverflowException. It is now stored, like every other ranged double parameter. B1a readers drop non-finite values. No NaN guard or shared validation change is requested.

Checks

  • eadffe50, all SUCCESS (also verified by the independent review): Build (Windows) 40112883313, Test 40112883328 (merge dfeadc3, 3738/3738), SPDX 40112883247.
  • Final head db48598b (record-only), re-checked before merge (mergeable, CLEAN, no review comments): all SUCCESS: Build (Windows) 40119859776, Test 40119860103 (merge 7807e0f of db48598b into b7c2c36a, 3738/3738), SPDX 40119859840.

Generated by Michal Dengusiak and CodeClaude

🤖 Generated with Claude Code

michaldengusiak and others added 3 commits October 24, 2026 18:21
…S11-2)

SpaceSimulationResultParameter.UnmetHours metadata IntegerParameterValue(0, 8760)
-> DoubleParameterValue(0, 8760). The integer metadata rounded EnergyPlus
fractional not-met time on SetValue (Convert.ToInt32: 14.5 -> 14, 14.75 -> 15,
0.25 -> 0) and accepted out-of-range fractions (-0.25 -> 0, 8760.25 -> 8760).

Member, ordinal (34), key "Unmet Hours", range and JSON model unchanged.
Integer values in older saved results and Tas whole-hour counts read back
with the same numerical value. OccupiedUnmetHours, OccupiedHours,
UnmetHourFirstIndex and AdjacencyClusterSimulationResultParameter.UnmetHours
stay integer.

New SpaceSimulationResultUnmetHoursTests: 12 tests, 8 fail on the previous
metadata, all pass after.

Generated by Michal Dengusiak and CodeClaude

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record only: change, compatibility analysis, findings (SAM_Revit Integer
parameter risk, NaN behaviour), local validation and next step.

Generated by Michal Dengusiak and CodeClaude

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ks green

Record only. Owner deferral of SAM_Revit compatibility (finding 1),
independent review acceptance of the core fix, exact-head hosted checks at
eadffe5 (Build, Test 3738/3738, SPDX), next step = owner merge approval.
Tested content unchanged: 47cc5dd.

Generated by Michal Dengusiak and CodeClaude

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaldengusiak
michaldengusiak marked this pull request as ready for review October 24, 2026 18:20
@michaldengusiak
michaldengusiak merged commit ac68ad0 into sow/2026-Q4 Oct 24, 2026
3 checks passed
@michaldengusiak
michaldengusiak deleted the fix/s11-fractional-unmet-hours branch October 24, 2026 18:21
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.

1 participant