@open3cl/engine 1.8.35 → 1.8.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/15_conso_aux.js +14 -3
- package/15_conso_aux.spec.js +64 -0
- package/9_chauffage.js +1 -0
- package/9_chauffage.spec.js +9 -0
- package/README.md +22 -22
- package/engine.js +1 -1
- package/package.json +1 -1
package/15_conso_aux.js
CHANGED
|
@@ -57,9 +57,20 @@ export function conso_aux_gen(di, de, type, besoin, besoin_dep) {
|
|
|
57
57
|
*/
|
|
58
58
|
const Paux_g_ch = g + h * (pe / 1000);
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Pour les installations collectives, la conso des auxiliaires est calculée à partir du besoin
|
|
62
|
+
* de l'appartement (clé de répartition).
|
|
63
|
+
* Pour une installation de chauffage individuelle (enum_type_installation_id = 1), la clé
|
|
64
|
+
* n'est pas appliquée : le besoin reçu est déjà proratisé par Sc / Sh dans calc_chauffage, et
|
|
65
|
+
* le moteur de référence CSTB (Tribu) n'utilise aucune clé de répartition pour ces
|
|
66
|
+
* installations (DPE.Core : Calcul_installation.cs l.79-80, Calcul_generateur.cs l.1497,
|
|
67
|
+
* Calcul_batiment.cs l.652). La clé reste appliquée au collectif et à l'ECS.
|
|
68
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §15.1
|
|
69
|
+
*/
|
|
70
|
+
const ignoreCle = type === 'ch' && String(de.enum_type_installation_id) === '1';
|
|
71
|
+
const cle = ignoreCle ? 1 : de[`cle_repartition_${type}`] || 1;
|
|
72
|
+
let besoinAppart = besoin * cle;
|
|
73
|
+
let besoinAppartDep = besoin_dep * cle;
|
|
63
74
|
|
|
64
75
|
/**
|
|
65
76
|
* Le besoin reçu est déjà celui de l'installation : calc_chauffage le proratise par
|
package/15_conso_aux.spec.js
CHANGED
|
@@ -229,6 +229,70 @@ describe('conso_aux_gen - auxiliaires de génération', () => {
|
|
|
229
229
|
10
|
|
230
230
|
);
|
|
231
231
|
});
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Issue #252 : la clé de répartition du chauffage n'est pas appliquée au besoin d'une
|
|
235
|
+
* installation individuelle (enum_type_installation_id = 1) : ce besoin est déjà proratisé
|
|
236
|
+
* par Sc / Sh, et le moteur CSTB (Tribu) n'utilise aucune clé pour ces installations.
|
|
237
|
+
* La clé reste appliquée au collectif et à l'ECS.
|
|
238
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf - §15.1
|
|
239
|
+
*/
|
|
240
|
+
describe('clé de répartition (issue #252)', () => {
|
|
241
|
+
test('chauffage, installation individuelle : la clé de répartition est ignorée', () => {
|
|
242
|
+
const de = {
|
|
243
|
+
enum_type_generateur_ch_id: '90',
|
|
244
|
+
enum_type_installation_id: '1',
|
|
245
|
+
cle_repartition_ch: 0.5
|
|
246
|
+
};
|
|
247
|
+
conso_aux_gen(di, de, 'ch', 1000, 1200, 100);
|
|
248
|
+
// Paux = 20 + 1,6 × 20 = 52 W ; conso = 52 × 1000 / 20000 = 2,6 (sans facteur 0,5)
|
|
249
|
+
expect(di.conso_auxiliaire_generation_ch).toBeCloseTo(2.6, 10);
|
|
250
|
+
expect(di.conso_auxiliaire_generation_ch_depensier).toBeCloseTo(3.12, 10);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
test('chauffage, installation individuelle (identifiant numérique) : clé ignorée', () => {
|
|
254
|
+
const de = {
|
|
255
|
+
enum_type_generateur_ch_id: '90',
|
|
256
|
+
enum_type_installation_id: 1,
|
|
257
|
+
cle_repartition_ch: 0.5
|
|
258
|
+
};
|
|
259
|
+
conso_aux_gen(di, de, 'ch', 1000, 1200, 100);
|
|
260
|
+
expect(di.conso_auxiliaire_generation_ch).toBeCloseTo(2.6, 10);
|
|
261
|
+
expect(di.conso_auxiliaire_generation_ch_depensier).toBeCloseTo(3.12, 10);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
test('chauffage, installation collective : la clé de répartition est appliquée', () => {
|
|
265
|
+
const de = {
|
|
266
|
+
enum_type_generateur_ch_id: '90',
|
|
267
|
+
enum_type_installation_id: '2',
|
|
268
|
+
cle_repartition_ch: 0.5
|
|
269
|
+
};
|
|
270
|
+
conso_aux_gen(di, de, 'ch', 1000, 1200, 100);
|
|
271
|
+
// conso = 52 × (1000 × 0,5) / 20000 = 1,3
|
|
272
|
+
expect(di.conso_auxiliaire_generation_ch).toBeCloseTo(1.3, 10);
|
|
273
|
+
expect(di.conso_auxiliaire_generation_ch_depensier).toBeCloseTo(1.56, 10);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
test("chauffage, type d'installation non renseigné : la clé de répartition est appliquée", () => {
|
|
277
|
+
const de = { enum_type_generateur_ch_id: '90', cle_repartition_ch: 0.5 };
|
|
278
|
+
conso_aux_gen(di, de, 'ch', 1000, 1200, 100);
|
|
279
|
+
expect(di.conso_auxiliaire_generation_ch).toBeCloseTo(1.3, 10);
|
|
280
|
+
expect(di.conso_auxiliaire_generation_ch_depensier).toBeCloseTo(1.56, 10);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
test('ECS, installation individuelle : la clé de répartition ECS reste appliquée', () => {
|
|
284
|
+
const de = {
|
|
285
|
+
enum_type_generateur_ecs_id: '50',
|
|
286
|
+
enum_type_installation_id: '1',
|
|
287
|
+
cle_repartition_ecs: 0.5,
|
|
288
|
+
cle_repartition_ch: 0.25
|
|
289
|
+
};
|
|
290
|
+
conso_aux_gen(di, de, 'ecs', 800, 1000, 100);
|
|
291
|
+
// Sans clé : 2,08 / 2,6 ; avec la clé ECS 0,5 : 1,04 / 1,3
|
|
292
|
+
expect(di.conso_auxiliaire_generation_ecs).toBeCloseTo(1.04, 10);
|
|
293
|
+
expect(di.conso_auxiliaire_generation_ecs_depensier).toBeCloseTo(1.3, 10);
|
|
294
|
+
});
|
|
295
|
+
});
|
|
232
296
|
});
|
|
233
297
|
|
|
234
298
|
/**
|
package/9_chauffage.js
CHANGED
|
@@ -69,6 +69,7 @@ export default function calc_chauffage(
|
|
|
69
69
|
|
|
70
70
|
genChDe.ratio_virtualisation = de.ratio_virtualisation || 1;
|
|
71
71
|
genChDe.cle_repartition_ch = de.cle_repartition_ch || 1;
|
|
72
|
+
genChDe.enum_type_installation_id = de.enum_type_installation_id;
|
|
72
73
|
genChDe.surface_chauffee = de.surface_chauffee || Sh;
|
|
73
74
|
genChDe.rdim_installation_ch = isImmeuble(map_id) ? Number(de.rdim) || 1 : 1;
|
|
74
75
|
genChDe.nombre_niveau_installation_ch = de.nombre_niveau_installation_ch || 1;
|
package/9_chauffage.spec.js
CHANGED
|
@@ -219,6 +219,15 @@ describe('calc_chauffage - cas nominal (1 générateur, 1 émetteur)', () => {
|
|
|
219
219
|
expect(genDe.nombre_niveau_installation_ch).toBe(4);
|
|
220
220
|
});
|
|
221
221
|
|
|
222
|
+
test("propage le type d'installation au générateur (clé de répartition, issue #252)", () => {
|
|
223
|
+
const ch = installation([generateur()], [emetteur('1')], {});
|
|
224
|
+
ch.donnee_entree.enum_type_installation_id = '1';
|
|
225
|
+
appel(ch);
|
|
226
|
+
|
|
227
|
+
const genDe = ch.generateur_chauffage_collection.generateur_chauffage[0].donnee_entree;
|
|
228
|
+
expect(genDe.enum_type_installation_id).toBe('1');
|
|
229
|
+
});
|
|
230
|
+
|
|
222
231
|
test('prorata unitaire : le besoin complet est transmis au générateur', () => {
|
|
223
232
|
const ch = installation([generateur()], [emetteur('1')]);
|
|
224
233
|
appel(ch, { bch: 800 });
|
package/README.md
CHANGED
|
@@ -370,57 +370,57 @@ Ces résultats sont **générés automatiquement** à la fin de `npm run test:co
|
|
|
370
370
|
|
|
371
371
|
<!-- CORPUS:START -->
|
|
372
372
|
|
|
373
|
-
> **Version `1.8.
|
|
373
|
+
> **Version `1.8.35`** · branche `main` · généré le 2026-10-09
|
|
374
374
|
> Seuil de tolérance **5%**
|
|
375
375
|
|
|
376
376
|
<table>
|
|
377
377
|
<tr>
|
|
378
378
|
<td align="center"><strong>9</strong><br/><sub>corpus</sub></td>
|
|
379
|
-
<td align="center"><strong>89
|
|
380
|
-
<td align="center"><strong>61
|
|
381
|
-
<td align="center"><strong>68,
|
|
379
|
+
<td align="center"><strong>89 984</strong><br/><sub>DPE analysés</sub></td>
|
|
380
|
+
<td align="center"><strong>61 950</strong><br/><sub>DPE conformes</sub></td>
|
|
381
|
+
<td align="center"><strong>68,85 %</strong><br/><sub>réussite globale</sub></td>
|
|
382
382
|
</tr>
|
|
383
383
|
</table>
|
|
384
384
|
|
|
385
385
|
| | Corpus | Réussite | | DPE conformes |
|
|
386
386
|
| :-: | :---------------------------------------------------------------------------------------------------------------------- | ----------: | :--------------------- | -------------: |
|
|
387
|
-
| 🔴 | **Généraliste**<br/><sub>`corpus_dpe.csv`</sub> | **46,
|
|
387
|
+
| 🔴 | **Généraliste**<br/><sub>`corpus_dpe.csv`</sub> | **46,18 %** | `█████████░░░░░░░░░░░` | 4 618 / 9 999 |
|
|
388
388
|
| 🟢 | **Appartement · chauffage individuel (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_individuel_2025.csv`</sub> | **92,53 %** | `███████████████████░` | 9 253 / 10 000 |
|
|
389
389
|
| 🟢 | **Logement individuel (2025)**<br/><sub>`dpe_logement_individuel_2025.csv`</sub> | **89,54 %** | `██████████████████░░` | 8 947 / 9 992 |
|
|
390
|
-
| 🟢 | **Maison individuelle (2025)**<br/><sub>`dpe_maison_individuelle_2025.csv`</sub> | **88,
|
|
390
|
+
| 🟢 | **Maison individuelle (2025)**<br/><sub>`dpe_maison_individuelle_2025.csv`</sub> | **88,61 %** | `██████████████████░░` | 8 860 / 9 999 |
|
|
391
391
|
| 🟡 | **Immeuble · chauffage individuel**<br/><sub>`dpe_immeuble_chauffage_individuel.csv`</sub> | **84,21 %** | `█████████████████░░░` | 8 419 / 9 998 |
|
|
392
|
-
| 🟡 | **Appartement · chauffage collectif (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_collectif_2025.csv`</sub> | **71,
|
|
392
|
+
| 🟡 | **Appartement · chauffage collectif (2025)**<br/><sub>`dpe_appartement_individuel_chauffage_collectif_2025.csv`</sub> | **71,60 %** | `██████████████░░░░░░` | 7 160 / 10 000 |
|
|
393
393
|
| 🟡 | **Immeuble · chauffage collectif**<br/><sub>`dpe_immeuble_chauffage_collectif.csv`</sub> | **66,19 %** | `█████████████░░░░░░░` | 6 618 / 9 999 |
|
|
394
|
-
| 🔴 | **Immeuble · chauffage mixte**<br/><sub>`dpe_immeuble_chauffage_mixte.csv`</sub> | **53,
|
|
394
|
+
| 🔴 | **Immeuble · chauffage mixte**<br/><sub>`dpe_immeuble_chauffage_mixte.csv`</sub> | **53,71 %** | `███████████░░░░░░░░░` | 5 369 / 9 997 |
|
|
395
395
|
| 🔴 | **Individuel généré depuis l'immeuble (2026)**<br/><sub>`dpe_individuel_a_partir_dpe_immeuble_2026.csv`</sub> | **27,06 %** | `█████░░░░░░░░░░░░░░░` | 2 706 / 10 000 |
|
|
396
396
|
|
|
397
397
|
<sub>🟢 ≥ 85 % · 🟡 ≥ 60 % · 🔴 < 60 %</sub>
|
|
398
398
|
|
|
399
399
|
#### Temps d’exécution
|
|
400
400
|
|
|
401
|
-
> Durée de l’appel à `calcul_3cl` par DPE, sur 89
|
|
401
|
+
> Durée de l’appel à `calcul_3cl` par DPE, sur 89 950 calculs.
|
|
402
402
|
> La copie défensive de l’entrée et la lecture du fichier sont exclues de la mesure.
|
|
403
403
|
|
|
404
404
|
<table>
|
|
405
405
|
<tr>
|
|
406
|
-
<td align="center"><strong>5,
|
|
407
|
-
<td align="center"><strong>
|
|
408
|
-
<td align="center"><strong>0,
|
|
409
|
-
<td align="center"><strong>
|
|
406
|
+
<td align="center"><strong>5,06 ms</strong><br/><sub>moyenne</sub></td>
|
|
407
|
+
<td align="center"><strong>4,41 ms</strong><br/><sub>médiane</sub></td>
|
|
408
|
+
<td align="center"><strong>0,11 ms</strong><br/><sub>min</sub></td>
|
|
409
|
+
<td align="center"><strong>768,9 ms</strong><br/><sub>max</sub></td>
|
|
410
410
|
</tr>
|
|
411
411
|
</table>
|
|
412
412
|
|
|
413
413
|
| Corpus | Moyenne | Médiane | Min | Max | p95 | p99 |
|
|
414
414
|
| :--------------------------------------------- | ------: | ------: | ------: | -------: | ------: | ------: |
|
|
415
|
-
| **Généraliste** | 4,
|
|
416
|
-
| **Appartement · chauffage individuel (2025)** | 3,
|
|
417
|
-
| **Logement individuel (2025)** |
|
|
418
|
-
| **Maison individuelle (2025)** |
|
|
419
|
-
| **Immeuble · chauffage individuel** | 6,
|
|
420
|
-
| **Appartement · chauffage collectif (2025)** | 4,
|
|
421
|
-
| **Immeuble · chauffage collectif** | 5,
|
|
422
|
-
| **Immeuble · chauffage mixte** |
|
|
423
|
-
| **Individuel généré depuis l'immeuble (2026)** |
|
|
415
|
+
| **Généraliste** | 4,20 ms | 3,76 ms | 0,22 ms | 34,2 ms | 7,69 ms | 10,6 ms |
|
|
416
|
+
| **Appartement · chauffage individuel (2025)** | 3,75 ms | 3,39 ms | 1,47 ms | 29,4 ms | 6,55 ms | 8,36 ms |
|
|
417
|
+
| **Logement individuel (2025)** | 4,83 ms | 4,30 ms | 1,55 ms | 29,3 ms | 9,03 ms | 12,1 ms |
|
|
418
|
+
| **Maison individuelle (2025)** | 5,88 ms | 5,27 ms | 1,84 ms | 50,5 ms | 10,7 ms | 13,9 ms |
|
|
419
|
+
| **Immeuble · chauffage individuel** | 6,26 ms | 5,33 ms | 0,11 ms | 74,5 ms | 12,9 ms | 19,8 ms |
|
|
420
|
+
| **Appartement · chauffage collectif (2025)** | 4,16 ms | 3,75 ms | 1,41 ms | 35,8 ms | 6,88 ms | 8,69 ms |
|
|
421
|
+
| **Immeuble · chauffage collectif** | 5,42 ms | 4,62 ms | 0,12 ms | 106,1 ms | 10,1 ms | 17,7 ms |
|
|
422
|
+
| **Immeuble · chauffage mixte** | 5,23 ms | 4,26 ms | 0,17 ms | 768,9 ms | 10,7 ms | 17,1 ms |
|
|
423
|
+
| **Individuel généré depuis l'immeuble (2026)** | 5,81 ms | 5,00 ms | 1,65 ms | 42,2 ms | 11,0 ms | 16,4 ms |
|
|
424
424
|
|
|
425
425
|
<sub>La moyenne est tirée vers le haut par les DPE collectifs, dont le coût atteint plusieurs
|
|
426
426
|
dizaines de fois la médiane : c’est la médiane qui décrit le cas courant, et p95/p99 le cas
|
package/engine.js
CHANGED
|
@@ -33,7 +33,7 @@ import getFicheTechnique from './ficheTechnique.js';
|
|
|
33
33
|
import { ProductionENR, ratioProrataPvLogement } from './16.2_production_enr.js';
|
|
34
34
|
import DpeSanitizerService from './dpe-sanitizer.service.js';
|
|
35
35
|
|
|
36
|
-
const LIB_VERSION = '1.8.
|
|
36
|
+
const LIB_VERSION = '1.8.36';
|
|
37
37
|
|
|
38
38
|
const dpeSanitizerService = new DpeSanitizerService();
|
|
39
39
|
|