Skip to content

Building codes: Hidropan's diversity factor for 2 to 9 units as its Tabela 4 prints it - #511

Closed
ffishman wants to merge 5 commits into
IPedrax:feat/building-codefrom
ffishman:hidropan-diversity-below-ten
Closed

ffishman wants to merge 5 commits into
IPedrax:feat/building-codefrom
ffishman:hidropan-diversity-below-ten

Conversation

@ffishman

Copy link
Copy Markdown
Contributor

Stacked on #509 (which sits on #506 and #502); only the last commit is new here.

What

Hidropan's RIC BT 2014, Tabela 4 (page 76), prints nine rows with no count above its "up to 10" = 9.64: 1.00, 1.96, 2.92, 3.88, 4.84, 5.80, 6.76, 7.72, 8.68. They step by 0.96 to 9.64 at 10 and equal Cemig's Tabela 12 and Celesc's Tabela 01 for 4 to 9, so they are the factors for 1 to 9 units. BIMCraft took 9.64 for any Hidropan building of 2 to 10 units, which overstated a small building's demand (4 units: 9.64 instead of 3.88).

  • hidropan.json: the rows for 2 to 9 are in the diversity table (1 unit stays out, as before: the method is for buildings of 2 or more). The sources no longer say Hidropan's diversity table is Fecoergs's Anexo U throughout; they are the same from 10 units up.
  • Fecoergs is unchanged: its Anexo U (page 92) leaves those rows blank, and its own examples (Anexo S) take 9.64 for 6 and 8 units.

Tests

  • New hidropan_prints_a_factor_for_each_count_under_ten_and_fecoergs_does_not: Hidropan 2 to 10 units against the printed rows, Fecoergs at 9.64 for 2 to 10, and a 4-unit building of 120 m² worked by hand (1.2 × 3.88 × 2.54). It fails on the old data (2 units: 9.64, not 1.96).
  • the_brazilian_utilities_share_one_diversity_table now checks Hidropan against Celesc from 4 units instead of 11.
  • cargo test -p bimcraft-core (including the property tests), cargo clippy -p bimcraft-core --all-targets -- -D warnings, cargo fmt --check and cargo i18n check pass.

…tables changed in its amendment

Fixes 1 to 3 of the list in IPedrax#486.

- A rule that is text but reads like a number (circuits.default_method, "7")
  is written as JSON, so NBR 5410 and anything on it imports again. known()
  takes the rules of every library code holding a section, and the electrical
  settings are named by the user, so any name comes back. A utility's or a
  country's method is imported as the file has it, never completed from
  another utility's.
- unit_demand, building_demand and entrance are a utility's method whole
  (codes::WHOLE): an amendment holding one replaces the one under it instead
  of being merged rule by rule. demand, building_demand and entrance read each
  chosen amendment's own section (Model::held_wholes), so a change in CPFL's
  amendment counts wherever it stands and CPFL never answers by Celesc's table.
- A project-level change to one of those sections is refused, pointing at
  `amend`: it would belong to no utility once another is chosen.
- A collapsible `if` in the circuit's breaker, for clippy.

Tests: six new, each seen failing on 3d4e4ca and passing here.
…lectrical settings in step with the codes

Fixes 4 to 6 of the list in IPedrax#486, and the two ui-egui tests failing on 3d4e4ca.

- A code of the project's own holding a utility's or a country's method
  can't be deleted while the project is held to it; other codes keep
  their rules as before.
- `set` naming the base in force (the default included) keeps the
  amendments and their changes.
- from_codes follows the codes: null takes an entry away, one no longer
  named goes back to the starter's or away, unless an element names it.
  A starter entry taken away is written as null; renaming a voltage
  renames it in the code's systems; a system naming a voltage the
  project wouldn't have, or a null over a setting an element names, is
  refused. `amend` takes a setting away whoever had it.
- An amendment's few settings are laid over the library's others.
- The codes dialog flattens objects inside rows to any depth; a new
  voltage's band follows its nominal while still the default.
- The property test of IPedrax#486 goes in as crates/core/tests/property.rs
  (200 sequences under cargo test).
- The code of a project that chose none held NBR 5410's Tabelas 36 and 37 as its own wire types, cited as IEC 60364-5-52.
  It holds them no more: the library hands NBR 5410's on, saying whose they are. A test holds every discipline's default
  code, every edition included, to no copy of another code's tables, row by row.
- NBR 5410: the 4 % drop of a terminal circuit is item 6.2.7.2 (the JSON and the plan), and the standard fixes no waveform
  for the impulse current (the JSON and dps.rs's comments).
- The 10 % band round the Brazilian and North American voltages is BIMCraft's own practice, and says so.
- Cemig's Tabelas 12 and 13 by their printed pages; five rows of Fecoergs's and Hidropan's area table off the curve, not four;
  the REBT's ITC-BT-10 as consolidated after Real Decreto 1053/2014.
…abela 4 prints it

Hidropan RIC BT 2014 Tabela 4 prints nine rows with no count above its
'up to 10' = 9.64: 1.00 and then 0.96 more each, which step to 9.64 at
10 and equal Cemig's and Celesc's factors for 4 to 9, so they are 1 to 9
units. BIMCraft took 9.64 for any building of 2 to 10 units; the rows
for 2 to 9 are now in the table. Fecoergs's Anexo U leaves those rows
blank and its own examples take 9.64 for 6 and 8 units, so it stays.
@github-project-automation github-project-automation Bot moved this to Backlog in BIMCraft Nov 17, 2026
IPedrax added a commit that referenced this pull request Nov 18, 2026
…its as its Tabela 4 prints it (ffishman)

The head of #511 carries the whole chain under it: dansity's five-discipline Building Codes engine (#486) and ffishman's #502, #506 and #509 on top of it, then the Hidropan rows. Joined onto main, the sections engine replaces main's building-codes.json and its electrical part, since a utility is now an amendment and a country a base code of the electrical discipline: main's `electrical`, `country` and `Model::electrical_methods` are gone, `building_code {electrical}` is refused with a message saying where the methods went, and `demand` takes the project's utility when none is named, as `building_demand` already did. Main's stair fixes (solve capped at 200 risers, the IBC numbers marked unchecked, the test module the hostile sweep reads) and #484's per-member tables (`members`, Energisa's Tabela 16, its test) are carried onto the new files. EN 1992-1-1 stays a second standard of `reinforce {check}` beside the structural code's Concrete section. FORMAT 21's note and the 20 to 21 comment in `migrate` describe `codes`. The catalogs are the union of both sides, for the round's one regeneration.
IPedrax added a commit that referenced this pull request Nov 18, 2026
…dards, Hidropan's diversity (dansity, ffishman)

Joins the codes-chain branch. #511's head holds #486's engine (five disciplines, layered codes and amendments, 29 code files under
data/codes/, the dialog's five tabs) and ffishman's fixes on top (XML round trips, a held code's method on the base in force, the electrical
numbers checked against their standards, Hidropan's diversity factor for 2 to 9 units). The engine replaces the electrical part of yesterday's
codes (electrical_methods, the Electrical Demand tab): the same methods now come through an amendment or a base code, and `demand` and
`building_demand` default to the code the project is held to. No conflict with the other joins of the round in code; the root CLAUDE.md is
trimmed under its 3,000 words, and the catalogs are regenerated on CI after this merge.
@IPedrax

IPedrax commented Nov 18, 2026

Copy link
Copy Markdown
Owner

This PR's commits are in main at f4cdeaf, joined with the November round together with #486 and the rest of the building codes stack. GitHub didn't mark it merged because its base is feat/building-code, not main. Closing for that reason only. Thank you.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants