Skip to content

demand: other utilities' service categories as data - #484

Merged
IPedrax merged 1 commit into
IPedrax:mainfrom
ffishman:entrance-categories
Nov 17, 2026
Merged

IPedrax merged 1 commit into
IPedrax:mainfrom
ffishman:entrance-categories

Conversation

@ffishman

Copy link
Copy Markdown
Contributor

demand: other utilities' service categories as data

demand knows three utilities, CPFL, Enel and Celesc, each written as Rust tables. Most other Brazilian utilities print the same kind of table: a category, its phases, the installed load or demand it covers, the breaker, the conductors and the earthing. This PR reads those tables from one data file, so adding a utility means adding an entry to the file, with no new code. CPFL, Enel and Celesc stay as they are.

This follows the approach proposed to dansity on #474 (#474 (comment)): each utility's data carries its source, edition and page, ready to move into the Building Code menu of #386 when that lands.

The mechanism

  • data/entrance-categories.json, read by entrance.rs:
    • Each utility, or group of utilities that share one standard, names its standard and the item or table and page of each table.
    • It has one table per supply system (lower voltage first, as 127/220) and per use (individual, metering_centre).
    • Rows are kept as printed: the category, its phases, the installed load (kW) and the demand (kVA) it covers, the breaker, the measurement, and the other columns under names the utility explains in columns.
  • A range runs from above over (or from 0) up to and including up_to, the way the tables print "de 5,1 a 8".
  • What demand returns for a utility of the file:
    • the first row that holds the unit;
    • every row that holds it (candidates), for example where a single-phase and a three-phase row both cover a load;
    • the rows that need a value that was not given (the installed load or the demand).
  • The demand is the designer's, passed in as a number. Each utility's own demand method stays in its own module or in building_demand (building_demand: a building's demand by a utility's or a country's method, as data #458).
  • Groups: members are found by their own names. A member may change a category by its own document, and the reply cites that document in changed_by.
  • New parameters: {utility, system?, entrance?, installed_kw?, demand_kva?, phases?}.

Utilities in this PR

  • Fecoergs (RIC BT REGD 035.01.06, revision of 23/08/2024, Anexo J):
    • Tables: 127/220, 220/380, rural 220/440 and the metering centre.
    • Members: the 15 Rio Grande do Sul cooperatives that share this RIC.
    • Two members change C18 by their own documents:
      • Coprel's OTD 006.01 v01 (24/09/2025) lets C18 be measured directly.
      • Cerfox's Informes técnicos 07-22 and 08-22 and OT_NIC_019 v3.0 keep C18 indirect, except in a case they name.
    • Fecoergs' errata do not touch Anexo J.
  • Hidropan (RIC 2014, Tabela 11).
  • Energisa (NDU 001 version 7.0, November 2024, Tabelas 16 and 18):
    • The group's companies (EAC, EMR, EMS, EMT, ERO, ESE, ESS, ETO, EPB) are members, found by their own names.
    • M and B rows go by the installed load, T rows by the demand.
  • Equatorial (NT.00001.EQTL revision 09, approved 22/05/2025, Tabelas 1 and 2):
    • Every row goes by the installed load.
    • The tables print no category names, so each row is named by the phases and breaker printed in its breaker column ("25 (MONO)" becomes MONO 25 A).
    • Not covered: the two tables that Nota Técnica 004/2026 adds for a unit fed by its own single-phase transformer (binding from 24/02/2027). They are listed in not_covered.
  • Copel (NTC 901100, revision of 01/07/2020, Tabela 2):
    • Rows go by the maximum demand.
    • The rural categories (19, 22, 25, 46 to 48, single-phase three-wire at 127/254 V) are a table of their own.
    • The breakers that notes 9 and 10 allow are given as a second value.

Every value was checked against the printed page, not only against text extracted from the PDF.

Tests

They check that:

  • every table names its page;
  • every column is explained;
  • the installed-load ranges leave no gap;
  • within a group of the same phases and installed load, the demand ranges have no gap or overlap and the breaker never shrinks;
  • every change a member makes names a category that exists;
  • each utility picks its categories at printed values and at the edges of the ranges;
  • a member is found by its own name and its document is cited;
  • demand refuses a parameter that a utility of the file does not take.

Not in this PR

  • Santa Catarina's cooperatives (Fecoerusc, FECO-D-04).
  • São Paulo's and Rio de Janeiro's cooperatives (Fecoeresp, NTC-D-04).
  • Cemirim.

Each has a table of its own, and they will come in a later PR the same way.

data/entrance-categories.json, read by entrance.rs, holds each utility's
tables of categories as printed (phases, installed load and demand
ranges, breaker, measurement and the other columns, each explained), and
demand picks a unit's category from it. Groups list their members, found
by their own names, and a member's own document on a category is cited.

First utilities: Fecoergs (RIC BT REGD 035.01.06, Anexo J; Coprel's OTD
006.01 and Cerfox's OT_NIC_019 on C18), Hidropan (RIC 2014, Tabela 11),
Energisa (NDU 001 v7.0, Tabelas 16 and 18), Equatorial (NT.00001 rev 09,
Tabelas 1 and 2) and Copel (NTC 901100, Tabela 2).
@github-project-automation github-project-automation Bot moved this to Backlog in BIMCraft Nov 16, 2026
dansity added a commit that referenced this pull request Nov 16, 2026
# Conflicts:
#	CLAUDE.md
#	docs/areas/structure-and-mep.md
#	translations/project/bimcraft-project.pot
#	translations/project/cs.po
#	translations/project/de.po
#	translations/project/es.po
#	translations/project/fr.po
#	translations/project/it.po
#	translations/project/nl.po
#	translations/project/pl.po
#	translations/project/pt.po
#	translations/project/sv.po
#	translations/project/vi.po
#	translations/ui/bimcraft-ui.pot
#	translations/ui/cs.po
#	translations/ui/de.po
#	translations/ui/es.po
#	translations/ui/fr.po
#	translations/ui/it.po
#	translations/ui/nl.po
#	translations/ui/pl.po
#	translations/ui/pt.po
#	translations/ui/vi.po
#	translations/ui/zh.po
#	translations/ui/zh_TW.po
IPedrax added a commit that referenced this pull request Nov 17, 2026
The line references moved with the demand and Building Codes changes; no message changed.
IPedrax added a commit that referenced this pull request Nov 17, 2026
… the round

Brings ffishman's data and entrance.rs with the maintainer's fixes: Building Codes' Demand picker and its citation list the utilities whose categories are data, a broken data file is an error in its test, and Energisa's Tabela 16 is offered only to the members its note names. No conflict with the three earlier branches; the catalogs are each side's union.
@IPedrax
IPedrax merged commit d7c03c7 into IPedrax:main Nov 17, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done 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.
ffishman added a commit to ffishman/BIMCraft that referenced this pull request Nov 20, 2026
Each fails under a deliberate break that the tests let through before: a range from 0 holds 0, and each row answers at its
own upper end (and its demand's), in every utility's table and by every method (IPedrax#484, IPedrax#474); each building method at its
least number of dwellings and not one fewer (IPedrax#483); an outdoor rule asks it of outlets only, whatever kinds a code lists
(IPedrax#359); a room with its outlets and no light point is short, and enough once its light is drawn (IPedrax#280); a 3D file over the
limit refused by its size, before it is read (IPedrax#393); only a common property set has the status the export writes (IPedrax#291); a
beam at the view range's top is seen, and hidden by a ceiling there (IPedrax#153); Run Script says a single warning (IPedrax#391).
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