@open3cl/engine 1.4.4 → 1.4.6

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/README.md CHANGED
@@ -83,7 +83,12 @@ C'est un bon moyen de détecter un éventuel problème dans le dpe ou la librair
83
83
  ## Utilisation
84
84
 
85
85
  ```javascript
86
- import { calcul_3cl } from 'open3cl';
86
+ import { @open3cl } from 'open3cl/engine';
87
+ import {
88
+ set_bug_for_bug_compat,
89
+ } from '@open3cl/engine/utils.js';
90
+
91
+ set_bug_for_bug_compat();
87
92
 
88
93
  // Exemple d'objet JSON (partiel) issu d'un fichier XML DPE
89
94
  const dpeData = {
@@ -307,20 +312,38 @@ Résultats des tests de corpus avec le mode de compatibilité activé.
307
312
  | 1.4.2 | dpe_immeuble_chauffage_collectif.csv | 6144 | 61% | |
308
313
  | 1.4.2 | dpe_immeuble_chauffage_mixte.csv | 4758 | 47% | |
309
314
  | 1.4.2 | dpe_individuel_a_partir_dpe_immeuble_2026.csv | 2757 | 27% | |
315
+ | <ins>**1.4.3**<ins> | <ins>**corpus_dpe.csv**<ins> | <ins>**4556**<ins> | <ins>**45%**<ins> | |
316
+ | 1.4.3 | dpe_logement_individuel_2025.csv | 8716 | 87% | |
317
+ | 1.4.3 | dpe_maison_individuelle_2025.csv | 8715 | 87% | |
318
+ | 1.4.3 | dpe_appartement_individuel_chauffage_individuel_2025.csv | 9070 | 91% | |
319
+ | 1.4.3 | dpe_appartement_individuel_chauffage_collectif_2025.csv | 6804 | 68% | |
320
+ | 1.4.3 | dpe_immeuble_chauffage_individuel.csv | 7320 | 73% | |
321
+ | 1.4.3 | dpe_immeuble_chauffage_collectif.csv | 6149 | 61% | |
322
+ | 1.4.3 | dpe_immeuble_chauffage_mixte.csv | 4805 | 48% | |
323
+ | 1.4.3 | dpe_individuel_a_partir_dpe_immeuble_2026.csv | 2755 | 27% | |
324
+ | <ins>**1.4.4**<ins> | <ins>**corpus_dpe.csv**<ins> | <ins>**4560 (+4)**<ins> | <ins>**45%**<ins> | |
325
+ | 1.4.4 | dpe_logement_individuel_2025.csv | 8719 (+3) | 87% (+2%) | |
326
+ | 1.4.4 | dpe_maison_individuelle_2025.csv | 8715 | 87% | |
327
+ | 1.4.4 | dpe_appartement_individuel_chauffage_individuel_2025.csv | 9070 | 91% | |
328
+ | 1.4.4 | dpe_appartement_individuel_chauffage_collectif_2025.csv | 6803 (-1) | 68% | |
329
+ | 1.4.4 | dpe_immeuble_chauffage_individuel.csv | 7320 | 73% | |
330
+ | 1.4.4 | dpe_immeuble_chauffage_collectif.csv | 6149 | 61% | |
331
+ | 1.4.4 | dpe_immeuble_chauffage_mixte.csv | 4805 | 48% | |
332
+ | 1.4.4 | dpe_individuel_a_partir_dpe_immeuble_2026.csv | 2755 | 27% | |
310
333
 
311
334
  </details>
312
335
 
313
- | Version librairie | corpus | Nb en dessous du taux d'erreur | Taux de réussite | Description |
314
- | :------------------ | -------------------------------------------------------- | ------------------------------ | ----------------- | ----------- |
315
- | <ins>**1.4.3**<ins> | <ins>**corpus_dpe.csv**<ins> | <ins>**4556 (+41)**<ins> | <ins>**45%**<ins> | |
316
- | 1.4.3 | dpe_logement_individuel_2025.csv | 8716 (+204) | 87% (+2%) | |
317
- | 1.4.3 | dpe_maison_individuelle_2025.csv | 8715 (+39) | 87% | |
318
- | 1.4.3 | dpe_appartement_individuel_chauffage_individuel_2025.csv | 9070 (+489) | 91% (+5%) | |
319
- | 1.4.3 | dpe_appartement_individuel_chauffage_collectif_2025.csv | 6804 (+124) | 68% (+1%) | |
320
- | 1.4.3 | dpe_immeuble_chauffage_individuel.csv | 7320 (+177) | 73% (+2%) | |
321
- | 1.4.3 | dpe_immeuble_chauffage_collectif.csv | 6149 (+5) | 61% | |
322
- | 1.4.3 | dpe_immeuble_chauffage_mixte.csv | 4805 (+47) | 48% | |
323
- | 1.4.3 | dpe_individuel_a_partir_dpe_immeuble_2026.csv | 2755 (-2) | 27% | |
336
+ | Version librairie | corpus | Nb en dessous du taux d'erreur | Taux de réussite | Description |
337
+ | :------------------ | -------------------------------------------------------- | ------------------------------ | ----------------------- | ----------- |
338
+ | <ins>**1.4.5**<ins> | <ins>**corpus_dpe.csv**<ins> | <ins>**4582 (+22)**<ins> | <ins>**46% (+1%)**<ins> | |
339
+ | 1.4.5 | dpe_logement_individuel_2025.csv | 8790 (+71) | 88% (+1%) | |
340
+ | 1.4.5 | dpe_maison_individuelle_2025.csv | 8791 (+76) | 88% (+1%) | |
341
+ | 1.4.5 | dpe_appartement_individuel_chauffage_individuel_2025.csv | 9143 (+73) | 91% | |
342
+ | 1.4.5 | dpe_appartement_individuel_chauffage_collectif_2025.csv | 6836 (+33) | 68% | |
343
+ | 1.4.5 | dpe_immeuble_chauffage_individuel.csv | 7371 (+51) | 74% (+1%) | |
344
+ | 1.4.5 | dpe_immeuble_chauffage_collectif.csv | 6155 (+6) | 61% | |
345
+ | 1.4.5 | dpe_immeuble_chauffage_mixte.csv | 4816 (+11S) | 48% | |
346
+ | 1.4.5 | dpe_individuel_a_partir_dpe_immeuble_2026.csv | 2755 | 27% | |
324
347
 
325
348
  ## Roadmap
326
349
 
@@ -1,28 +1,39 @@
1
1
  import { ObjectUtil } from './core/util/infrastructure/object-util.js';
2
+ import { set, has } from 'lodash-es';
2
3
 
3
4
  const nodesToMap = [
4
- 'mur',
5
- 'plancher_bas',
6
- 'plancher_haut',
7
- 'baie_vitree',
8
- 'porte',
9
- 'pont_thermique',
10
- 'ventilation',
11
5
  'installation_ecs',
12
6
  'generateur_ecs',
13
- 'climatisation',
14
7
  'installation_chauffage',
15
8
  'generateur_chauffage',
16
9
  'emetteur_chauffage',
17
10
  'sortie_par_energie'
18
11
  ];
19
12
 
13
+ const nodesCollectionToCheck = [
14
+ 'logement.enveloppe.mur_collection.mur',
15
+ 'logement.enveloppe.plancher_bas_collection.plancher_bas',
16
+ 'logement.enveloppe.plancher_haut_collection.plancher_haut',
17
+ 'logement.ventilation_collection.ventilation',
18
+ 'logement.climatisation_collection.climatisation',
19
+ 'logement.enveloppe.baie_vitree_collection.baie_vitree',
20
+ 'logement.enveloppe.porte_collection.porte',
21
+ 'logement.enveloppe.pont_thermique_collection.pont_thermique'
22
+ ];
23
+
20
24
  /**
21
25
  * Transform single nodes in {@link nodesToMap} into array of nodes.
22
26
  * Transform string number into digits
23
27
  * These transformations should be done inside the open3cl library
24
28
  *
25
29
  * @example
30
+ *
31
+ * // Will create
32
+ * "plancher_haut_collection": {
33
+ * "plancher_haut": []
34
+ * }
35
+ * if the plancher_haut_collection.plancher_haut nodes does not exist or are not an array
36
+ *
26
37
  * // Will transform
27
38
  * "plancher_haut_collection": {
28
39
  * "plancher_haut": {"id": 1}
@@ -44,6 +55,12 @@ export default class DpeSanitizerService {
44
55
  * @return {FullDpe}
45
56
  */
46
57
  execute(dpe) {
58
+ for (const path of nodesCollectionToCheck) {
59
+ if (!has(dpe, path)) {
60
+ set(dpe, path, []);
61
+ }
62
+ }
63
+
47
64
  return ObjectUtil.deepObjectTransform(
48
65
  dpe,
49
66
  (key) => key,
package/engine.js CHANGED
@@ -28,7 +28,7 @@ import getFicheTechnique from './ficheTechnique.js';
28
28
  import { ProductionENR } from './16.2_production_enr.js';
29
29
  import DpeSanitizerService from './dpe-sanitizer.service.js';
30
30
 
31
- const LIB_VERSION = '1.4.4';
31
+ const LIB_VERSION = '1.4.6';
32
32
 
33
33
  const dpeSanitizerService = new DpeSanitizerService();
34
34
 
@@ -271,9 +271,15 @@ export function calcul_3cl(inputDpe, options) {
271
271
  * Inertie ID
272
272
  * 1 - Très lourde
273
273
  * 2 - Lourde
274
+ * 3 - Moyenne
275
+ * 4 - Légère
276
+ *
277
+ * Cf. issue #149 : l'utilisation de la variable batiment_materiaux_anciens
278
+ * n'est plus conditionnée par la classe d'inertie ni par le type de logement
279
+ * (maison ou appartement). On considère le bâtiment comme à inertie lourde
280
+ * dès lors que la variable batiment_materiaux_anciens vaut 1.
274
281
  */
275
- const ilpa =
276
- logement.meteo.batiment_materiaux_anciens === 1 && ['1', '2'].includes(inertie_id) ? '1' : '0';
282
+ const ilpa = logement.meteo.batiment_materiaux_anciens === 1 ? '1' : '0';
277
283
 
278
284
  const ecs = logement.installation_ecs_collection.installation_ecs || [];
279
285
  const Nb_lgt = cg.nombre_appartement || 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open3cl/engine",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Open Source 3CL-DPE engine",
5
5
  "main": "index.js",
6
6
  "directories": {