jsthermalcomfort 1.4.0 → 2.0.0-next.2

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.
Files changed (538) hide show
  1. package/README.md +115 -25
  2. package/lib/esm/_internal/adaptive_cooling_effect.js +14 -0
  3. package/lib/esm/_internal/ashrae55.js +121 -0
  4. package/lib/esm/_internal/brentq.js +216 -0
  5. package/lib/esm/_internal/classifierBins.js +67 -0
  6. package/lib/esm/_internal/define.js +215 -0
  7. package/lib/esm/_internal/errors.js +45 -0
  8. package/lib/esm/_internal/floatRepr.js +33 -0
  9. package/lib/esm/_internal/fsolve.js +879 -0
  10. package/lib/esm/_internal/modelInfo.js +107 -0
  11. package/lib/esm/_internal/pythonSum.js +104 -0
  12. package/lib/esm/_internal/round.js +58 -0
  13. package/lib/esm/_internal/validation.js +83 -0
  14. package/lib/esm/clothing/_correction_clothing.js +20 -0
  15. package/lib/esm/clothing/clo_area_factor.js +24 -0
  16. package/lib/esm/clothing/clo_correction_factor_environment.js +35 -0
  17. package/lib/esm/clothing/clo_dynamic_ashrae.js +39 -0
  18. package/lib/esm/clothing/clo_dynamic_iso.js +93 -0
  19. package/lib/esm/clothing/clo_insulation_air_layer.js +25 -0
  20. package/lib/esm/clothing/clo_intrinsic_insulation_ensemble.js +31 -0
  21. package/lib/esm/clothing/clo_total_insulation.js +47 -0
  22. package/lib/esm/clothing/index.js +33 -0
  23. package/lib/esm/environment/f_svv.js +24 -0
  24. package/lib/esm/environment/index.js +31 -0
  25. package/lib/esm/environment/mean_radiant_tmp.js +83 -0
  26. package/lib/esm/environment/operative_tmp.js +31 -0
  27. package/lib/esm/environment/running_mean_outdoor_temperature.js +126 -0
  28. package/lib/esm/environment/scale_wind_speed_log.js +165 -0
  29. package/lib/esm/environment/transpose_sharp_altitude.js +19 -0
  30. package/lib/esm/environment/v_relative.js +23 -0
  31. package/lib/esm/index.js +14 -1
  32. package/lib/esm/jos3_functions/bsa_rate.js +1 -1
  33. package/lib/esm/jos3_functions/conductance.js +2 -2
  34. package/lib/esm/models/JOS3.js +195 -28
  35. package/lib/esm/models/_pmv_ppd_optimized.js +57 -0
  36. package/lib/esm/models/adaptive_ashrae.js +135 -98
  37. package/lib/esm/models/adaptive_en.js +127 -111
  38. package/lib/esm/models/ankle_draft.js +148 -77
  39. package/lib/esm/models/at.js +54 -41
  40. package/lib/esm/models/clo_tout.js +61 -32
  41. package/lib/esm/models/cooling_effect.js +124 -154
  42. package/lib/esm/models/discomfort_index.js +78 -64
  43. package/lib/esm/models/esi.js +65 -0
  44. package/lib/esm/models/heat_index_lu.js +358 -0
  45. package/lib/esm/models/heat_index_rothfusz.js +91 -0
  46. package/lib/esm/models/heat_index_schoen.js +76 -0
  47. package/lib/esm/models/humidex.js +82 -51
  48. package/lib/esm/models/index.js +134 -42
  49. package/lib/esm/models/ireq.js +414 -0
  50. package/lib/esm/models/net.js +48 -32
  51. package/lib/esm/models/pet_steady.js +356 -445
  52. package/lib/esm/models/phs.js +597 -427
  53. package/lib/esm/models/pmv_a.js +143 -0
  54. package/lib/esm/models/pmv_athb.js +110 -0
  55. package/lib/esm/models/pmv_e.js +179 -0
  56. package/lib/esm/models/pmv_ppd_ashrae.js +231 -62
  57. package/lib/esm/models/pmv_ppd_iso.js +248 -65
  58. package/lib/esm/models/ridge_regression_predict_t_re_t_sk.js +375 -0
  59. package/lib/esm/models/set_tmp.js +112 -110
  60. package/lib/esm/models/solar_gain.js +233 -126
  61. package/lib/esm/models/sports_heat_stress_risk.js +454 -0
  62. package/lib/esm/models/thi.js +46 -0
  63. package/lib/esm/models/two_nodes_gagge.js +432 -0
  64. package/lib/esm/models/two_nodes_gagge_ji.js +340 -0
  65. package/lib/esm/models/two_nodes_gagge_sleep.js +520 -0
  66. package/lib/esm/models/use_fans_heatwaves.js +205 -0
  67. package/lib/esm/models/utci.js +336 -381
  68. package/lib/esm/models/vertical_tmp_grad_ppd.js +138 -90
  69. package/lib/esm/models/wbgt.js +66 -65
  70. package/lib/esm/models/wci.js +70 -0
  71. package/lib/esm/models/wind_chill_temperature.js +59 -34
  72. package/lib/esm/models/work_capacity_dunne.js +65 -0
  73. package/lib/esm/models/work_capacity_hothaps.js +84 -0
  74. package/lib/esm/models/work_capacity_iso.js +56 -0
  75. package/lib/esm/models/work_capacity_niosh.js +56 -0
  76. package/lib/esm/psychrometrics/antoine.js +12 -0
  77. package/lib/esm/psychrometrics/dew_point_tmp.js +34 -0
  78. package/lib/esm/psychrometrics/enthalpy_air.js +18 -0
  79. package/lib/esm/psychrometrics/hr_to_rh.js +28 -0
  80. package/lib/esm/psychrometrics/index.js +29 -14
  81. package/lib/esm/psychrometrics/p_sat.js +24 -28
  82. package/lib/esm/psychrometrics/p_sat_torr.js +6 -6
  83. package/lib/esm/psychrometrics/psy_ta_rh.js +50 -30
  84. package/lib/esm/psychrometrics/rh_from_dew_point.js +28 -0
  85. package/lib/esm/psychrometrics/rh_from_vapour_pressure.js +25 -0
  86. package/lib/esm/psychrometrics/rh_from_wet_bulb.js +51 -0
  87. package/lib/esm/psychrometrics/wet_bulb_tmp.js +19 -0
  88. package/lib/esm/types/_internal/adaptive_cooling_effect.d.ts +12 -0
  89. package/lib/esm/types/_internal/adaptive_cooling_effect.d.ts.map +1 -0
  90. package/lib/esm/types/_internal/ashrae55.d.ts +92 -0
  91. package/lib/esm/types/_internal/ashrae55.d.ts.map +1 -0
  92. package/lib/esm/types/_internal/brentq.d.ts +27 -0
  93. package/lib/esm/types/_internal/brentq.d.ts.map +1 -0
  94. package/lib/esm/types/_internal/classifierBins.d.ts +66 -0
  95. package/lib/esm/types/_internal/classifierBins.d.ts.map +1 -0
  96. package/lib/esm/types/_internal/define.d.ts +108 -0
  97. package/lib/esm/types/_internal/define.d.ts.map +1 -0
  98. package/lib/esm/types/_internal/errors.d.ts +24 -0
  99. package/lib/esm/types/_internal/errors.d.ts.map +1 -0
  100. package/lib/esm/types/_internal/floatRepr.d.ts +20 -0
  101. package/lib/esm/types/_internal/floatRepr.d.ts.map +1 -0
  102. package/lib/esm/types/_internal/fsolve.d.ts +33 -0
  103. package/lib/esm/types/_internal/fsolve.d.ts.map +1 -0
  104. package/lib/esm/types/_internal/modelInfo.d.ts +434 -0
  105. package/lib/esm/types/_internal/modelInfo.d.ts.map +1 -0
  106. package/lib/esm/types/_internal/pythonSum.d.ts +14 -0
  107. package/lib/esm/types/_internal/pythonSum.d.ts.map +1 -0
  108. package/lib/esm/types/_internal/round.d.ts +36 -0
  109. package/lib/esm/types/_internal/round.d.ts.map +1 -0
  110. package/lib/esm/types/_internal/validation.d.ts +69 -0
  111. package/lib/esm/types/_internal/validation.d.ts.map +1 -0
  112. package/lib/esm/types/clothing/_correction_clothing.d.ts +11 -0
  113. package/lib/esm/types/clothing/_correction_clothing.d.ts.map +1 -0
  114. package/lib/esm/types/clothing/clo_area_factor.d.ts +20 -0
  115. package/lib/esm/types/clothing/clo_area_factor.d.ts.map +1 -0
  116. package/lib/esm/types/clothing/clo_correction_factor_environment.d.ts +19 -0
  117. package/lib/esm/types/clothing/clo_correction_factor_environment.d.ts.map +1 -0
  118. package/lib/esm/types/clothing/clo_dynamic_ashrae.d.ts +25 -0
  119. package/lib/esm/types/clothing/clo_dynamic_ashrae.d.ts.map +1 -0
  120. package/lib/esm/types/clothing/clo_dynamic_iso.d.ts +59 -0
  121. package/lib/esm/types/clothing/clo_dynamic_iso.d.ts.map +1 -0
  122. package/lib/esm/types/clothing/clo_insulation_air_layer.d.ts +18 -0
  123. package/lib/esm/types/clothing/clo_insulation_air_layer.d.ts.map +1 -0
  124. package/lib/esm/types/clothing/clo_intrinsic_insulation_ensemble.d.ts +15 -0
  125. package/lib/esm/types/clothing/clo_intrinsic_insulation_ensemble.d.ts.map +1 -0
  126. package/lib/esm/types/clothing/clo_total_insulation.d.ts +28 -0
  127. package/lib/esm/types/clothing/clo_total_insulation.d.ts.map +1 -0
  128. package/lib/esm/types/clothing/index.d.ts +33 -0
  129. package/lib/esm/types/clothing/index.d.ts.map +1 -0
  130. package/lib/esm/types/environment/f_svv.d.ts +10 -0
  131. package/lib/esm/types/environment/f_svv.d.ts.map +1 -0
  132. package/lib/esm/types/environment/index.d.ts +32 -0
  133. package/lib/esm/types/environment/index.d.ts.map +1 -0
  134. package/lib/esm/types/environment/mean_radiant_tmp.d.ts +35 -0
  135. package/lib/esm/types/environment/mean_radiant_tmp.d.ts.map +1 -0
  136. package/lib/esm/types/environment/operative_tmp.d.ts +12 -0
  137. package/lib/esm/types/environment/operative_tmp.d.ts.map +1 -0
  138. package/lib/esm/types/environment/running_mean_outdoor_temperature.d.ts +80 -0
  139. package/lib/esm/types/environment/running_mean_outdoor_temperature.d.ts.map +1 -0
  140. package/lib/esm/types/environment/scale_wind_speed_log.d.ts +100 -0
  141. package/lib/esm/types/environment/scale_wind_speed_log.d.ts.map +1 -0
  142. package/lib/esm/types/environment/transpose_sharp_altitude.d.ts +3 -0
  143. package/lib/esm/types/environment/transpose_sharp_altitude.d.ts.map +1 -0
  144. package/lib/esm/types/environment/v_relative.d.ts +16 -0
  145. package/lib/esm/types/environment/v_relative.d.ts.map +1 -0
  146. package/lib/esm/types/index.d.ts +2998 -11
  147. package/lib/esm/types/index.d.ts.map +1 -1
  148. package/lib/esm/types/models/JOS3.d.ts +180 -24
  149. package/lib/esm/types/models/JOS3.d.ts.map +1 -1
  150. package/lib/esm/types/models/_pmv_ppd_optimized.d.ts +2 -0
  151. package/lib/esm/types/models/_pmv_ppd_optimized.d.ts.map +1 -0
  152. package/lib/esm/types/models/adaptive_ashrae.d.ts +181 -39
  153. package/lib/esm/types/models/adaptive_ashrae.d.ts.map +1 -1
  154. package/lib/esm/types/models/adaptive_en.d.ts +174 -59
  155. package/lib/esm/types/models/adaptive_en.d.ts.map +1 -1
  156. package/lib/esm/types/models/ankle_draft.d.ts +158 -14
  157. package/lib/esm/types/models/ankle_draft.d.ts.map +1 -1
  158. package/lib/esm/types/models/at.d.ts +86 -11
  159. package/lib/esm/types/models/at.d.ts.map +1 -1
  160. package/lib/esm/types/models/clo_tout.d.ts +78 -9
  161. package/lib/esm/types/models/clo_tout.d.ts.map +1 -1
  162. package/lib/esm/types/models/cooling_effect.d.ts +126 -10
  163. package/lib/esm/types/models/cooling_effect.d.ts.map +1 -1
  164. package/lib/esm/types/models/discomfort_index.d.ts +87 -16
  165. package/lib/esm/types/models/discomfort_index.d.ts.map +1 -1
  166. package/lib/esm/types/models/esi.d.ts +74 -0
  167. package/lib/esm/types/models/esi.d.ts.map +1 -0
  168. package/lib/esm/types/models/heat_index_lu.d.ts +72 -0
  169. package/lib/esm/types/models/heat_index_lu.d.ts.map +1 -0
  170. package/lib/esm/types/models/heat_index_rothfusz.d.ts +97 -0
  171. package/lib/esm/types/models/heat_index_rothfusz.d.ts.map +1 -0
  172. package/lib/esm/types/models/heat_index_schoen.d.ts +78 -0
  173. package/lib/esm/types/models/heat_index_schoen.d.ts.map +1 -0
  174. package/lib/esm/types/models/humidex.d.ts +93 -20
  175. package/lib/esm/types/models/humidex.d.ts.map +1 -1
  176. package/lib/esm/types/models/index.d.ts +2991 -61
  177. package/lib/esm/types/models/index.d.ts.map +1 -1
  178. package/lib/esm/types/models/ireq.d.ts +201 -0
  179. package/lib/esm/types/models/ireq.d.ts.map +1 -0
  180. package/lib/esm/types/models/net.d.ts +89 -11
  181. package/lib/esm/types/models/net.d.ts.map +1 -1
  182. package/lib/esm/types/models/pet_steady.d.ts +147 -21
  183. package/lib/esm/types/models/pet_steady.d.ts.map +1 -1
  184. package/lib/esm/types/models/phs.d.ts +436 -173
  185. package/lib/esm/types/models/phs.d.ts.map +1 -1
  186. package/lib/esm/types/models/pmv_a.d.ts +179 -0
  187. package/lib/esm/types/models/pmv_a.d.ts.map +1 -0
  188. package/lib/esm/types/models/pmv_athb.d.ts +122 -0
  189. package/lib/esm/types/models/pmv_athb.d.ts.map +1 -0
  190. package/lib/esm/types/models/pmv_e.d.ts +197 -0
  191. package/lib/esm/types/models/pmv_e.d.ts.map +1 -0
  192. package/lib/esm/types/models/pmv_ppd_ashrae.d.ts +249 -14
  193. package/lib/esm/types/models/pmv_ppd_ashrae.d.ts.map +1 -1
  194. package/lib/esm/types/models/pmv_ppd_iso.d.ts +258 -14
  195. package/lib/esm/types/models/pmv_ppd_iso.d.ts.map +1 -1
  196. package/lib/esm/types/models/ridge_regression_predict_t_re_t_sk.d.ts +225 -0
  197. package/lib/esm/types/models/ridge_regression_predict_t_re_t_sk.d.ts.map +1 -0
  198. package/lib/esm/types/models/set_tmp.d.ts +154 -24
  199. package/lib/esm/types/models/set_tmp.d.ts.map +1 -1
  200. package/lib/esm/types/models/solar_gain.d.ts +185 -19
  201. package/lib/esm/types/models/solar_gain.d.ts.map +1 -1
  202. package/lib/esm/types/models/sports_heat_stress_risk.d.ts +250 -0
  203. package/lib/esm/types/models/sports_heat_stress_risk.d.ts.map +1 -0
  204. package/lib/esm/types/models/thi.d.ts +59 -0
  205. package/lib/esm/types/models/thi.d.ts.map +1 -0
  206. package/lib/esm/types/models/two_nodes_gagge.d.ts +307 -0
  207. package/lib/esm/types/models/two_nodes_gagge.d.ts.map +1 -0
  208. package/lib/esm/types/models/two_nodes_gagge_ji.d.ts +169 -0
  209. package/lib/esm/types/models/two_nodes_gagge_ji.d.ts.map +1 -0
  210. package/lib/esm/types/models/two_nodes_gagge_sleep.d.ts +283 -0
  211. package/lib/esm/types/models/two_nodes_gagge_sleep.d.ts.map +1 -0
  212. package/lib/esm/types/models/use_fans_heatwaves.d.ts +268 -0
  213. package/lib/esm/types/models/use_fans_heatwaves.d.ts.map +1 -0
  214. package/lib/esm/types/models/utci.d.ts +157 -11
  215. package/lib/esm/types/models/utci.d.ts.map +1 -1
  216. package/lib/esm/types/models/vertical_tmp_grad_ppd.d.ts +157 -16
  217. package/lib/esm/types/models/vertical_tmp_grad_ppd.d.ts.map +1 -1
  218. package/lib/esm/types/models/wbgt.d.ts +98 -9
  219. package/lib/esm/types/models/wbgt.d.ts.map +1 -1
  220. package/lib/esm/types/models/wci.d.ts +84 -0
  221. package/lib/esm/types/models/wci.d.ts.map +1 -0
  222. package/lib/esm/types/models/wind_chill_temperature.d.ts +79 -3
  223. package/lib/esm/types/models/wind_chill_temperature.d.ts.map +1 -1
  224. package/lib/esm/types/models/work_capacity_dunne.d.ts +72 -0
  225. package/lib/esm/types/models/work_capacity_dunne.d.ts.map +1 -0
  226. package/lib/esm/types/models/work_capacity_hothaps.d.ts +84 -0
  227. package/lib/esm/types/models/work_capacity_hothaps.d.ts.map +1 -0
  228. package/lib/esm/types/models/work_capacity_iso.d.ts +62 -0
  229. package/lib/esm/types/models/work_capacity_iso.d.ts.map +1 -0
  230. package/lib/esm/types/models/work_capacity_niosh.d.ts +57 -0
  231. package/lib/esm/types/models/work_capacity_niosh.d.ts.map +1 -0
  232. package/lib/esm/types/psychrometrics/antoine.d.ts +8 -0
  233. package/lib/esm/types/psychrometrics/antoine.d.ts.map +1 -0
  234. package/lib/esm/types/psychrometrics/dew_point_tmp.d.ts +23 -0
  235. package/lib/esm/types/psychrometrics/dew_point_tmp.d.ts.map +1 -0
  236. package/lib/esm/types/psychrometrics/enthalpy_air.d.ts +9 -0
  237. package/lib/esm/types/psychrometrics/enthalpy_air.d.ts.map +1 -0
  238. package/lib/esm/types/psychrometrics/hr_to_rh.d.ts +20 -0
  239. package/lib/esm/types/psychrometrics/hr_to_rh.d.ts.map +1 -0
  240. package/lib/esm/types/psychrometrics/index.d.ts +38 -19
  241. package/lib/esm/types/psychrometrics/index.d.ts.map +1 -1
  242. package/lib/esm/types/psychrometrics/p_sat.d.ts +4 -9
  243. package/lib/esm/types/psychrometrics/p_sat.d.ts.map +1 -1
  244. package/lib/esm/types/psychrometrics/p_sat_torr.d.ts +4 -7
  245. package/lib/esm/types/psychrometrics/p_sat_torr.d.ts.map +1 -1
  246. package/lib/esm/types/psychrometrics/psy_ta_rh.d.ts +42 -43
  247. package/lib/esm/types/psychrometrics/psy_ta_rh.d.ts.map +1 -1
  248. package/lib/esm/types/psychrometrics/rh_from_dew_point.d.ts +18 -0
  249. package/lib/esm/types/psychrometrics/rh_from_dew_point.d.ts.map +1 -0
  250. package/lib/esm/types/psychrometrics/rh_from_vapour_pressure.d.ts +18 -0
  251. package/lib/esm/types/psychrometrics/rh_from_vapour_pressure.d.ts.map +1 -0
  252. package/lib/esm/types/psychrometrics/rh_from_wet_bulb.d.ts +23 -0
  253. package/lib/esm/types/psychrometrics/rh_from_wet_bulb.d.ts.map +1 -0
  254. package/lib/esm/types/psychrometrics/wet_bulb_tmp.d.ts +9 -0
  255. package/lib/esm/types/psychrometrics/wet_bulb_tmp.d.ts.map +1 -0
  256. package/lib/esm/types/utilities/body_surface_area.d.ts +23 -0
  257. package/lib/esm/types/utilities/body_surface_area.d.ts.map +1 -0
  258. package/lib/esm/types/utilities/constants.d.ts +17 -0
  259. package/lib/esm/types/utilities/constants.d.ts.map +1 -0
  260. package/lib/esm/types/utilities/index.d.ts +89 -23
  261. package/lib/esm/types/utilities/index.d.ts.map +1 -1
  262. package/lib/esm/types/utilities/options.d.ts +81 -0
  263. package/lib/esm/types/utilities/options.d.ts.map +1 -0
  264. package/lib/esm/types/utilities/reference_tables.d.ts +131 -0
  265. package/lib/esm/types/utilities/reference_tables.d.ts.map +1 -0
  266. package/lib/esm/types/utilities/units_converter.d.ts +13 -0
  267. package/lib/esm/types/utilities/units_converter.d.ts.map +1 -0
  268. package/lib/esm/utilities/body_surface_area.js +49 -0
  269. package/lib/esm/utilities/constants.js +16 -0
  270. package/lib/esm/utilities/index.js +36 -15
  271. package/lib/esm/utilities/options.js +80 -0
  272. package/lib/esm/utilities/reference_tables.js +344 -0
  273. package/lib/esm/utilities/units_converter.js +64 -0
  274. package/package.json +48 -27
  275. package/lib/cjs/index.js +0 -26
  276. package/lib/cjs/jos3_functions/JOS3Defaults.js +0 -34
  277. package/lib/cjs/jos3_functions/bfb_rate.js +0 -75
  278. package/lib/cjs/jos3_functions/bsa_rate.js +0 -27
  279. package/lib/cjs/jos3_functions/capacity.js +0 -102
  280. package/lib/cjs/jos3_functions/conductance.js +0 -180
  281. package/lib/cjs/jos3_functions/local_bsa.js +0 -64
  282. package/lib/cjs/jos3_functions/matrix.js +0 -351
  283. package/lib/cjs/jos3_functions/thermoregulation/ava_blood_flow.js +0 -84
  284. package/lib/cjs/jos3_functions/thermoregulation/basal_met.js +0 -54
  285. package/lib/cjs/jos3_functions/thermoregulation/clo_area_factor.js +0 -13
  286. package/lib/cjs/jos3_functions/thermoregulation/conv_coef.js +0 -136
  287. package/lib/cjs/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js +0 -95
  288. package/lib/cjs/jos3_functions/thermoregulation/dry_r.js +0 -56
  289. package/lib/cjs/jos3_functions/thermoregulation/error_signals.js +0 -64
  290. package/lib/cjs/jos3_functions/thermoregulation/evaporation.js +0 -104
  291. package/lib/cjs/jos3_functions/thermoregulation/fixed_hc.js +0 -51
  292. package/lib/cjs/jos3_functions/thermoregulation/fixed_hr.js +0 -52
  293. package/lib/cjs/jos3_functions/thermoregulation/local_mbase.js +0 -79
  294. package/lib/cjs/jos3_functions/thermoregulation/local_q_work.js +0 -57
  295. package/lib/cjs/jos3_functions/thermoregulation/nonshivering.js +0 -104
  296. package/lib/cjs/jos3_functions/thermoregulation/operative_temp.js +0 -51
  297. package/lib/cjs/jos3_functions/thermoregulation/rad_coef.js +0 -83
  298. package/lib/cjs/jos3_functions/thermoregulation/resp_heat_loss.js +0 -23
  299. package/lib/cjs/jos3_functions/thermoregulation/shivering.js +0 -143
  300. package/lib/cjs/jos3_functions/thermoregulation/skin_blood_flow.js +0 -84
  301. package/lib/cjs/jos3_functions/thermoregulation/sum_bf.js +0 -59
  302. package/lib/cjs/jos3_functions/thermoregulation/sum_m.js +0 -75
  303. package/lib/cjs/jos3_functions/thermoregulation/wet_r.js +0 -62
  304. package/lib/cjs/jos3_functions/validate_body_parameters.js +0 -31
  305. package/lib/cjs/jos3_functions/weight_rate.js +0 -30
  306. package/lib/cjs/models/JOS3.js +0 -962
  307. package/lib/cjs/models/a_pmv.js +0 -107
  308. package/lib/cjs/models/adaptive_ashrae.js +0 -158
  309. package/lib/cjs/models/adaptive_en.js +0 -179
  310. package/lib/cjs/models/ankle_draft.js +0 -92
  311. package/lib/cjs/models/at.js +0 -64
  312. package/lib/cjs/models/athb.js +0 -83
  313. package/lib/cjs/models/clo_tout.js +0 -43
  314. package/lib/cjs/models/cooling_effect.js +0 -180
  315. package/lib/cjs/models/discomfort_index.js +0 -80
  316. package/lib/cjs/models/e_pmv.js +0 -112
  317. package/lib/cjs/models/heat_index.js +0 -94
  318. package/lib/cjs/models/humidex.js +0 -76
  319. package/lib/cjs/models/index.js +0 -91
  320. package/lib/cjs/models/net.js +0 -61
  321. package/lib/cjs/models/pet_steady.js +0 -482
  322. package/lib/cjs/models/phs.js +0 -597
  323. package/lib/cjs/models/pmv.js +0 -142
  324. package/lib/cjs/models/pmv_ppd.js +0 -263
  325. package/lib/cjs/models/pmv_ppd_ashrae.js +0 -79
  326. package/lib/cjs/models/pmv_ppd_iso.js +0 -78
  327. package/lib/cjs/models/set_tmp.js +0 -130
  328. package/lib/cjs/models/solar_gain.js +0 -181
  329. package/lib/cjs/models/two_nodes.js +0 -603
  330. package/lib/cjs/models/use_fans_heatwave.js +0 -233
  331. package/lib/cjs/models/utci.js +0 -533
  332. package/lib/cjs/models/vertical_tmp_grad_ppd.js +0 -106
  333. package/lib/cjs/models/wbgt.js +0 -90
  334. package/lib/cjs/models/wc.js +0 -42
  335. package/lib/cjs/models/wind_chill_temperature.js +0 -42
  336. package/lib/cjs/psychrometrics/enthalpy.js +0 -23
  337. package/lib/cjs/psychrometrics/index.js +0 -29
  338. package/lib/cjs/psychrometrics/p_sat.js +0 -45
  339. package/lib/cjs/psychrometrics/p_sat_torr.js +0 -15
  340. package/lib/cjs/psychrometrics/psy_ta_rh.js +0 -50
  341. package/lib/cjs/psychrometrics/t_dp.js +0 -18
  342. package/lib/cjs/psychrometrics/t_mrt.js +0 -76
  343. package/lib/cjs/psychrometrics/t_o.js +0 -55
  344. package/lib/cjs/psychrometrics/t_wb.js +0 -22
  345. package/lib/cjs/supa.js +0 -73
  346. package/lib/cjs/types/index.d.ts +0 -13
  347. package/lib/cjs/types/index.d.ts.map +0 -1
  348. package/lib/cjs/types/jos3_functions/JOS3Defaults.d.ts +0 -27
  349. package/lib/cjs/types/jos3_functions/JOS3Defaults.d.ts.map +0 -1
  350. package/lib/cjs/types/jos3_functions/bfb_rate.d.ts +0 -13
  351. package/lib/cjs/types/jos3_functions/bfb_rate.d.ts.map +0 -1
  352. package/lib/cjs/types/jos3_functions/bsa_rate.d.ts +0 -15
  353. package/lib/cjs/types/jos3_functions/bsa_rate.d.ts.map +0 -1
  354. package/lib/cjs/types/jos3_functions/capacity.d.ts +0 -19
  355. package/lib/cjs/types/jos3_functions/capacity.d.ts.map +0 -1
  356. package/lib/cjs/types/jos3_functions/conductance.d.ts +0 -13
  357. package/lib/cjs/types/jos3_functions/conductance.d.ts.map +0 -1
  358. package/lib/cjs/types/jos3_functions/local_bsa.d.ts +0 -19
  359. package/lib/cjs/types/jos3_functions/local_bsa.d.ts.map +0 -1
  360. package/lib/cjs/types/jos3_functions/matrix.d.ts +0 -63
  361. package/lib/cjs/types/jos3_functions/matrix.d.ts.map +0 -1
  362. package/lib/cjs/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts +0 -33
  363. package/lib/cjs/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts.map +0 -1
  364. package/lib/cjs/types/jos3_functions/thermoregulation/basal_met.d.ts +0 -13
  365. package/lib/cjs/types/jos3_functions/thermoregulation/basal_met.d.ts.map +0 -1
  366. package/lib/cjs/types/jos3_functions/thermoregulation/clo_area_factor.d.ts +0 -9
  367. package/lib/cjs/types/jos3_functions/thermoregulation/clo_area_factor.d.ts.map +0 -1
  368. package/lib/cjs/types/jos3_functions/thermoregulation/conv_coef.d.ts +0 -16
  369. package/lib/cjs/types/jos3_functions/thermoregulation/conv_coef.d.ts.map +0 -1
  370. package/lib/cjs/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts +0 -37
  371. package/lib/cjs/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts.map +0 -1
  372. package/lib/cjs/types/jos3_functions/thermoregulation/dry_r.d.ts +0 -12
  373. package/lib/cjs/types/jos3_functions/thermoregulation/dry_r.d.ts.map +0 -1
  374. package/lib/cjs/types/jos3_functions/thermoregulation/error_signals.d.ts +0 -27
  375. package/lib/cjs/types/jos3_functions/thermoregulation/error_signals.d.ts.map +0 -1
  376. package/lib/cjs/types/jos3_functions/thermoregulation/evaporation.d.ts +0 -46
  377. package/lib/cjs/types/jos3_functions/thermoregulation/evaporation.d.ts.map +0 -1
  378. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hc.d.ts +0 -5
  379. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hc.d.ts.map +0 -1
  380. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hr.d.ts +0 -9
  381. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hr.d.ts.map +0 -1
  382. package/lib/cjs/types/jos3_functions/thermoregulation/local_mbase.d.ts +0 -14
  383. package/lib/cjs/types/jos3_functions/thermoregulation/local_mbase.d.ts.map +0 -1
  384. package/lib/cjs/types/jos3_functions/thermoregulation/local_q_work.d.ts +0 -12
  385. package/lib/cjs/types/jos3_functions/thermoregulation/local_q_work.d.ts.map +0 -1
  386. package/lib/cjs/types/jos3_functions/thermoregulation/nonshivering.d.ts +0 -16
  387. package/lib/cjs/types/jos3_functions/thermoregulation/nonshivering.d.ts.map +0 -1
  388. package/lib/cjs/types/jos3_functions/thermoregulation/operative_temp.d.ts +0 -13
  389. package/lib/cjs/types/jos3_functions/thermoregulation/operative_temp.d.ts.map +0 -1
  390. package/lib/cjs/types/jos3_functions/thermoregulation/rad_coef.d.ts +0 -10
  391. package/lib/cjs/types/jos3_functions/thermoregulation/rad_coef.d.ts.map +0 -1
  392. package/lib/cjs/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts +0 -27
  393. package/lib/cjs/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts.map +0 -1
  394. package/lib/cjs/types/jos3_functions/thermoregulation/shivering.d.ts +0 -27
  395. package/lib/cjs/types/jos3_functions/thermoregulation/shivering.d.ts.map +0 -1
  396. package/lib/cjs/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts +0 -15
  397. package/lib/cjs/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts.map +0 -1
  398. package/lib/cjs/types/jos3_functions/thermoregulation/sum_bf.d.ts +0 -15
  399. package/lib/cjs/types/jos3_functions/thermoregulation/sum_bf.d.ts.map +0 -1
  400. package/lib/cjs/types/jos3_functions/thermoregulation/sum_m.d.ts +0 -39
  401. package/lib/cjs/types/jos3_functions/thermoregulation/sum_m.d.ts.map +0 -1
  402. package/lib/cjs/types/jos3_functions/thermoregulation/wet_r.d.ts +0 -13
  403. package/lib/cjs/types/jos3_functions/thermoregulation/wet_r.d.ts.map +0 -1
  404. package/lib/cjs/types/jos3_functions/validate_body_parameters.d.ts +0 -12
  405. package/lib/cjs/types/jos3_functions/validate_body_parameters.d.ts.map +0 -1
  406. package/lib/cjs/types/jos3_functions/weight_rate.d.ts +0 -20
  407. package/lib/cjs/types/jos3_functions/weight_rate.d.ts.map +0 -1
  408. package/lib/cjs/types/models/JOS3.d.ts +0 -385
  409. package/lib/cjs/types/models/JOS3.d.ts.map +0 -1
  410. package/lib/cjs/types/models/a_pmv.d.ts +0 -25
  411. package/lib/cjs/types/models/a_pmv.d.ts.map +0 -1
  412. package/lib/cjs/types/models/adaptive_ashrae.d.ts +0 -40
  413. package/lib/cjs/types/models/adaptive_ashrae.d.ts.map +0 -1
  414. package/lib/cjs/types/models/adaptive_en.d.ts +0 -65
  415. package/lib/cjs/types/models/adaptive_en.d.ts.map +0 -1
  416. package/lib/cjs/types/models/ankle_draft.d.ts +0 -15
  417. package/lib/cjs/types/models/ankle_draft.d.ts.map +0 -1
  418. package/lib/cjs/types/models/at.d.ts +0 -12
  419. package/lib/cjs/types/models/at.d.ts.map +0 -1
  420. package/lib/cjs/types/models/athb.d.ts +0 -10
  421. package/lib/cjs/types/models/athb.d.ts.map +0 -1
  422. package/lib/cjs/types/models/clo_tout.d.ts +0 -10
  423. package/lib/cjs/types/models/clo_tout.d.ts.map +0 -1
  424. package/lib/cjs/types/models/cooling_effect.d.ts +0 -11
  425. package/lib/cjs/types/models/cooling_effect.d.ts.map +0 -1
  426. package/lib/cjs/types/models/discomfort_index.d.ts +0 -19
  427. package/lib/cjs/types/models/discomfort_index.d.ts.map +0 -1
  428. package/lib/cjs/types/models/e_pmv.d.ts +0 -25
  429. package/lib/cjs/types/models/e_pmv.d.ts.map +0 -1
  430. package/lib/cjs/types/models/heat_index.d.ts +0 -13
  431. package/lib/cjs/types/models/heat_index.d.ts.map +0 -1
  432. package/lib/cjs/types/models/humidex.d.ts +0 -23
  433. package/lib/cjs/types/models/humidex.d.ts.map +0 -1
  434. package/lib/cjs/types/models/index.d.ts +0 -63
  435. package/lib/cjs/types/models/index.d.ts.map +0 -1
  436. package/lib/cjs/types/models/net.d.ts +0 -12
  437. package/lib/cjs/types/models/net.d.ts.map +0 -1
  438. package/lib/cjs/types/models/pet_steady.d.ts +0 -22
  439. package/lib/cjs/types/models/pet_steady.d.ts.map +0 -1
  440. package/lib/cjs/types/models/phs.d.ts +0 -174
  441. package/lib/cjs/types/models/phs.d.ts.map +0 -1
  442. package/lib/cjs/types/models/pmv.d.ts +0 -35
  443. package/lib/cjs/types/models/pmv.d.ts.map +0 -1
  444. package/lib/cjs/types/models/pmv_ppd.d.ts +0 -58
  445. package/lib/cjs/types/models/pmv_ppd.d.ts.map +0 -1
  446. package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts +0 -15
  447. package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts.map +0 -1
  448. package/lib/cjs/types/models/pmv_ppd_iso.d.ts +0 -15
  449. package/lib/cjs/types/models/pmv_ppd_iso.d.ts.map +0 -1
  450. package/lib/cjs/types/models/set_tmp.d.ts +0 -27
  451. package/lib/cjs/types/models/set_tmp.d.ts.map +0 -1
  452. package/lib/cjs/types/models/solar_gain.d.ts +0 -24
  453. package/lib/cjs/types/models/solar_gain.d.ts.map +0 -1
  454. package/lib/cjs/types/models/two_nodes.d.ts +0 -168
  455. package/lib/cjs/types/models/two_nodes.d.ts.map +0 -1
  456. package/lib/cjs/types/models/use_fans_heatwave.d.ts +0 -97
  457. package/lib/cjs/types/models/use_fans_heatwave.d.ts.map +0 -1
  458. package/lib/cjs/types/models/utci.d.ts +0 -14
  459. package/lib/cjs/types/models/utci.d.ts.map +0 -1
  460. package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts +0 -19
  461. package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts.map +0 -1
  462. package/lib/cjs/types/models/wbgt.d.ts +0 -10
  463. package/lib/cjs/types/models/wbgt.d.ts.map +0 -1
  464. package/lib/cjs/types/models/wc.d.ts +0 -6
  465. package/lib/cjs/types/models/wc.d.ts.map +0 -1
  466. package/lib/cjs/types/models/wind_chill_temperature.d.ts +0 -4
  467. package/lib/cjs/types/models/wind_chill_temperature.d.ts.map +0 -1
  468. package/lib/cjs/types/psychrometrics/enthalpy.d.ts +0 -12
  469. package/lib/cjs/types/psychrometrics/enthalpy.d.ts.map +0 -1
  470. package/lib/cjs/types/psychrometrics/index.d.ts +0 -21
  471. package/lib/cjs/types/psychrometrics/index.d.ts.map +0 -1
  472. package/lib/cjs/types/psychrometrics/p_sat.d.ts +0 -13
  473. package/lib/cjs/types/psychrometrics/p_sat.d.ts.map +0 -1
  474. package/lib/cjs/types/psychrometrics/p_sat_torr.d.ts +0 -11
  475. package/lib/cjs/types/psychrometrics/p_sat_torr.d.ts.map +0 -1
  476. package/lib/cjs/types/psychrometrics/psy_ta_rh.d.ts +0 -51
  477. package/lib/cjs/types/psychrometrics/psy_ta_rh.d.ts.map +0 -1
  478. package/lib/cjs/types/psychrometrics/t_dp.d.ts +0 -9
  479. package/lib/cjs/types/psychrometrics/t_dp.d.ts.map +0 -1
  480. package/lib/cjs/types/psychrometrics/t_mrt.d.ts +0 -23
  481. package/lib/cjs/types/psychrometrics/t_mrt.d.ts.map +0 -1
  482. package/lib/cjs/types/psychrometrics/t_o.d.ts +0 -15
  483. package/lib/cjs/types/psychrometrics/t_o.d.ts.map +0 -1
  484. package/lib/cjs/types/psychrometrics/t_wb.d.ts +0 -12
  485. package/lib/cjs/types/psychrometrics/t_wb.d.ts.map +0 -1
  486. package/lib/cjs/types/supa.d.ts +0 -25
  487. package/lib/cjs/types/supa.d.ts.map +0 -1
  488. package/lib/cjs/types/utilities/index.d.ts +0 -25
  489. package/lib/cjs/types/utilities/index.d.ts.map +0 -1
  490. package/lib/cjs/types/utilities/utilities.d.ts +0 -313
  491. package/lib/cjs/types/utilities/utilities.d.ts.map +0 -1
  492. package/lib/cjs/utilities/index.js +0 -31
  493. package/lib/cjs/utilities/utilities.js +0 -873
  494. package/lib/esm/models/a_pmv.js +0 -103
  495. package/lib/esm/models/athb.js +0 -80
  496. package/lib/esm/models/e_pmv.js +0 -108
  497. package/lib/esm/models/heat_index.js +0 -90
  498. package/lib/esm/models/pmv.js +0 -138
  499. package/lib/esm/models/pmv_ppd.js +0 -258
  500. package/lib/esm/models/two_nodes.js +0 -599
  501. package/lib/esm/models/use_fans_heatwave.js +0 -230
  502. package/lib/esm/models/wc.js +0 -39
  503. package/lib/esm/psychrometrics/enthalpy.js +0 -20
  504. package/lib/esm/psychrometrics/t_dp.js +0 -15
  505. package/lib/esm/psychrometrics/t_mrt.js +0 -73
  506. package/lib/esm/psychrometrics/t_o.js +0 -52
  507. package/lib/esm/psychrometrics/t_wb.js +0 -19
  508. package/lib/esm/types/models/a_pmv.d.ts +0 -25
  509. package/lib/esm/types/models/a_pmv.d.ts.map +0 -1
  510. package/lib/esm/types/models/athb.d.ts +0 -10
  511. package/lib/esm/types/models/athb.d.ts.map +0 -1
  512. package/lib/esm/types/models/e_pmv.d.ts +0 -25
  513. package/lib/esm/types/models/e_pmv.d.ts.map +0 -1
  514. package/lib/esm/types/models/heat_index.d.ts +0 -13
  515. package/lib/esm/types/models/heat_index.d.ts.map +0 -1
  516. package/lib/esm/types/models/pmv.d.ts +0 -35
  517. package/lib/esm/types/models/pmv.d.ts.map +0 -1
  518. package/lib/esm/types/models/pmv_ppd.d.ts +0 -58
  519. package/lib/esm/types/models/pmv_ppd.d.ts.map +0 -1
  520. package/lib/esm/types/models/two_nodes.d.ts +0 -168
  521. package/lib/esm/types/models/two_nodes.d.ts.map +0 -1
  522. package/lib/esm/types/models/use_fans_heatwave.d.ts +0 -97
  523. package/lib/esm/types/models/use_fans_heatwave.d.ts.map +0 -1
  524. package/lib/esm/types/models/wc.d.ts +0 -6
  525. package/lib/esm/types/models/wc.d.ts.map +0 -1
  526. package/lib/esm/types/psychrometrics/enthalpy.d.ts +0 -12
  527. package/lib/esm/types/psychrometrics/enthalpy.d.ts.map +0 -1
  528. package/lib/esm/types/psychrometrics/t_dp.d.ts +0 -9
  529. package/lib/esm/types/psychrometrics/t_dp.d.ts.map +0 -1
  530. package/lib/esm/types/psychrometrics/t_mrt.d.ts +0 -23
  531. package/lib/esm/types/psychrometrics/t_mrt.d.ts.map +0 -1
  532. package/lib/esm/types/psychrometrics/t_o.d.ts +0 -15
  533. package/lib/esm/types/psychrometrics/t_o.d.ts.map +0 -1
  534. package/lib/esm/types/psychrometrics/t_wb.d.ts +0 -12
  535. package/lib/esm/types/psychrometrics/t_wb.d.ts.map +0 -1
  536. package/lib/esm/types/utilities/utilities.d.ts +0 -313
  537. package/lib/esm/types/utilities/utilities.d.ts.map +0 -1
  538. package/lib/esm/utilities/utilities.js +0 -857
package/README.md CHANGED
@@ -33,46 +33,57 @@ Please cite us if you use this package: [Tartarini, F., Schiavon, S., 2020. pyth
33
33
  npm install jsthermalcomfort
34
34
  ```
35
35
 
36
- If you want to use jsthermalcomfort package without installing it on your local machine, you can import with:
37
-
38
- [`https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/`](https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/)
39
-
40
- Example:
36
+ Import functions by name, from the package root or from a subpath: `jsthermalcomfort/models`, `jsthermalcomfort/environment`, `jsthermalcomfort/clothing`, `jsthermalcomfort/psychrometrics` or `jsthermalcomfort/utilities`.
41
37
 
42
38
  ```javascript
43
- import {
44
- models,
45
- utilities,
46
- psychrometrics,
47
- } from "https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/index.js";
39
+ import { pmv_ppd_iso } from "jsthermalcomfort";
40
+ import { utci } from "jsthermalcomfort/models";
41
+
42
+ const { pmv, ppd } = pmv_ppd_iso({
43
+ tdb: 25,
44
+ tr: 25,
45
+ vr: 0.1,
46
+ rh: 50,
47
+ met: 1.2,
48
+ clo: 0.5,
49
+ });
50
+ console.log(pmv, ppd); // 0.08 5.1
51
+
52
+ const result = utci({ tdb: 25, tr: 25, v: 1, rh: 50 });
53
+ console.log(result.utci, result.stress_category); // 24.6 no thermal stress
48
54
  ```
49
55
 
50
- You can also import it in the website directly, and caution that you need to mark the script as module:
56
+ In a browser without a bundler, import from jsDelivr in a module script:
51
57
 
52
58
  ```html
53
59
  <script type="module">
54
- import {
55
- models,
56
- utilities,
57
- psychrometrics,
58
- } from "https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/index.js";
60
+ import { pmv_ppd_iso } from "https://cdn.jsdelivr.net/npm/jsthermalcomfort@2/+esm";
61
+
62
+ const { pmv, ppd } = pmv_ppd_iso({
63
+ tdb: 25,
64
+ tr: 25,
65
+ vr: 0.1,
66
+ rh: 50,
67
+ met: 1.2,
68
+ clo: 0.5,
69
+ });
70
+ console.log(pmv, ppd); // 0.08 5.1
59
71
  </script>
60
72
  ```
61
73
 
62
- # Examples and Tutorials
63
-
64
- We developed a few [examples](https://github.com/FedericoTartarini/jsthermalcomfort/tree/main/docs/examples) files on how to use some of the functions.
74
+ # Migrating from 1.4.0
65
75
 
66
- Here is a list of examples running in the browser:
76
+ 2.0.0 changes how every function is called and imported. The migration guide gives the rules that apply to every function, then each 1.4.0 function's before and after.
67
77
 
68
- - [PHS](/docs/examples/phs.html)
78
+ - Guide: [`docs/migration-v2.md`](docs/migration-v2.md)
79
+ - Online docs version: [Migrating from 1.4.0 to 2.0.0](https://federicotartarini.github.io/jsthermalcomfort/documents/migration-v2.html)
69
80
 
70
81
  # Contributing
71
82
 
72
83
  Contributions are welcome.
73
84
 
74
- - Contributor guide: [`docs_theme/contributing.md`](docs_theme/contributing.md)
75
- - Online docs version: [Contributing](https://federicotartarini.github.io/jsthermalcomfort/contributing.html)
85
+ - Contributor guide: [`docs/contributing.md`](docs/contributing.md)
86
+ - Online docs version: [Contributing](https://federicotartarini.github.io/jsthermalcomfort/documents/contributing.html)
76
87
  - Bug reports and feature requests: [GitHub Issues](https://github.com/FedericoTartarini/jsthermalcomfort/issues)
77
88
 
78
89
  ## Local development (quick start)
@@ -84,10 +95,89 @@ npm run check:format
84
95
  npm run build
85
96
  ```
86
97
 
98
+ ## Releasing
99
+
100
+ Releases are triggered by **pushing a git tag**. Merging publishes nothing —
101
+ nothing reaches npm until someone tags deliberately.
102
+
103
+ ### Tags, not branches
104
+
105
+ The publish workflow fires on any `v*` tag and has no branch filter. A git tag
106
+ points at a _commit_, not a branch, so a release can be cut from any branch:
107
+
108
+ ```
109
+ main ──●──●──● ← v1.4.0 tagged here
110
+ \
111
+ development ●──●──●──● ← v2.0.0-next.1 tagged here
112
+ ```
113
+
114
+ Both publish through the same workflow. What differs is the dist-tag, and that
115
+ is derived from the version rather than chosen by whoever runs the release.
116
+
117
+ ### Cutting a release
118
+
119
+ ```bash
120
+ # 1. set the version in package.json — it must match the tag exactly,
121
+ # the workflow fails the build otherwise
122
+ npm version 2.0.0 --no-git-tag-version
123
+
124
+ # 2. commit and push the version bump
125
+ git commit -am "2.0.0" && git push
126
+
127
+ # 3. tag and push the tag — this is the step that publishes
128
+ git tag v2.0.0 && git push origin v2.0.0
129
+ ```
130
+
131
+ ### Prereleases
132
+
133
+ A version containing a hyphen is a semver prerelease and is published under the
134
+ **`next`** dist-tag instead of `latest`:
135
+
136
+ ```bash
137
+ npm version 2.0.0-next.1 --no-git-tag-version
138
+ git commit -am "2.0.0-next.1" && git push
139
+ git tag v2.0.0-next.1 && git push origin v2.0.0-next.1
140
+ ```
141
+
142
+ Consumers opt in explicitly, and nobody on `^1.x` is affected:
143
+
144
+ ```bash
145
+ npm install jsthermalcomfort@next
146
+ ```
147
+
148
+ This is how work on `development` reaches front ends before the major release, so
149
+ packaging problems surface before they reach everyone. Cut as many as you like
150
+ — `next.1`, `next.2` and so on — each is a real installable package.
151
+
152
+ ### What protects you
153
+
154
+ | Guard | Effect |
155
+ | ------------------------------------------- | ---------------------------------------------------------------- |
156
+ | Version contains a hyphen → `--tag next` | Never touches `latest`; `^1.x` users see nothing |
157
+ | Version must equal the tag | Build fails on a mismatch rather than publishing the wrong thing |
158
+ | `check:format`, `npm test`, `npm run build` | All run before the publish step |
159
+ | GitHub release marked prerelease | Matches the npm dist-tag, so the two do not disagree |
160
+
161
+ `npm publish` writes `latest` unless told otherwise, which is why the dist-tag
162
+ is computed in the workflow. Leaving it to the person releasing is exactly how
163
+ a preview ends up as the default install.
164
+
165
+ ### One thing to be careful about
166
+
167
+ **Do not tag a final version (no hyphen) from `development` while it is still work in
168
+ progress.** Without a hyphen it publishes as `latest`, and `npm install
169
+ jsthermalcomfort` starts handing out an unfinished major. It is not easily
170
+ undone — npm allows unpublishing only within a short window.
171
+
172
+ Prereleases from `development`; the final `vX.0.0` after `development` merges into `main`,
173
+ so `latest` and the default branch agree about what the current release is.
174
+
87
175
  Validation datasets for model tests are fetched from
88
176
  `FedericoTartarini/validation-data-comfort-models` on GitHub (no submodule needed).
89
- By default tests use the `main` branch. To pin tests to a specific ref (tag/branch/commit), set
90
- `VALIDATION_DATA_REF` when running tests:
177
+ By default tests use the `v1.1.0` tag, the ref pythermalcomfort's own tests pin
178
+ (`unit_test_data_prefix` in its `tests/conftest.py`); bump it together with
179
+ upstream. To run the tests against another ref (tag/branch/commit), set
180
+ `VALIDATION_DATA_REF`:
91
181
 
92
182
  ```bash
93
183
  VALIDATION_DATA_REF=main npm test
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Return the adaptive cooling effect for an air speed and operative temperature.
3
+ *
4
+ * The cooling effect is non-zero only when operative temperature is at or
5
+ * above 25 °C **and** air speed meets the minimum threshold (0.6 m/s).
6
+ *
7
+ * @param v - Air speed, [m/s].
8
+ * @param to - Operative temperature, [°C].
9
+ * @returns Cooling effect magnitude, [°C].
10
+ */
11
+ export function adaptive_cooling_effect(v, to) {
12
+ const magnitude = v >= 1.2 ? 2.2 : v >= 0.9 ? 1.8 : v >= 0.6 ? 1.2 : 0.0;
13
+ return to >= 25.0 ? magnitude : 0.0;
14
+ }
@@ -0,0 +1,121 @@
1
+ import { operative_tmp } from "../environment/operative_tmp.js";
2
+ import { Standard } from "../utilities/options.js";
3
+ import { deepFreeze } from "./modelInfo.js";
4
+ import { _valid_range } from "./validation.js";
5
+ // The counterpart of upstream's `_internal/ashrae55.py`.
6
+ /**
7
+ * ASHRAE 55's limits that `_check_ashrae55_compliance` checks, keyed as its
8
+ * keyword arguments: the Table 7.3.4 single-variable limits, and `v_limited`'s.
9
+ * The models that call it reference these from their `*_INFO`.
10
+ */
11
+ export const ASHRAE_55_LIMITS = deepFreeze({
12
+ tdb: { min: 10.0, max: 40.0 },
13
+ tr: { min: 10.0, max: 40.0 },
14
+ v: { min: 0.0, max: 2.0 },
15
+ met: { min: 1.0, max: 4.0 },
16
+ clo: { min: 0.0, max: 1.5 },
17
+ v_limited: { min: 0.0, max: 0.2 },
18
+ });
19
+ /**
20
+ * The standards `_check_ashrae55_compliance` checks against: upstream's
21
+ * docstring calls it the "ASHRAE 55-2023 input applicability check"
22
+ * (`_internal/ashrae55.py:12`).
23
+ */
24
+ export const ASHRAE_55_COMPLIANCE_STANDARDS = deepFreeze([
25
+ Standard.ashrae_55_2023,
26
+ ]);
27
+ /**
28
+ * ASHRAE 55's still-air speed, 0.1 m/s: `cooling_effect` calculates the
29
+ * cooling effect only above it and computes the still-air SET at it
30
+ * (`models/cooling_effect.py:35-40, :141, :187`), and `pmv_ppd_ashrae`
31
+ * applies the cooling effect above it (`models/pmv_ppd_ashrae.py:190-199`).
32
+ */
33
+ export const ASHRAE_55_STILL_AIR_THRESHOLD = 0.1;
34
+ /**
35
+ * The fixed airspeed bounds of the §7.2.1.2 `airspeed_control` rules: `any`
36
+ * at every operative temperature, `cool` when the operative temperature is at
37
+ * or below 23 °C.
38
+ */
39
+ const ASHRAE_55_AIRSPEED_NO_CONTROL = deepFreeze({
40
+ any: { max: 0.8 },
41
+ cool: { max: 0.2 },
42
+ });
43
+ /**
44
+ * ASHRAE 55-2023 input applicability check.
45
+ *
46
+ * Implements the Table 7.3.4 single-variable limits and the §7.2.1.2
47
+ * `airspeed_control` cross-variable rules. Single-use compliance checks for other
48
+ * standards (ISO 7730, ISO 7933, fan_heatwaves) live inline in the respective model
49
+ * files.
50
+ *
51
+ * `v_param_name` (default `"v"`) controls how the airspeed variable is rendered in
52
+ * the range rows emitted by this function. Callers whose signature names the airspeed
53
+ * argument `vr` should pass `v_param_name="vr"` so the row's key matches the
54
+ * caller's variable name. It does not affect which value is checked.
55
+ *
56
+ * @param kwargs - The values to check, keyed as upstream's keyword arguments.
57
+ * @param warnings - The call's rows.
58
+ * @returns The values in `kwargs`' order (`tdb`, `tr`, then `v`, `met` and
59
+ * `clo`, and `v_limited` where given), each NaN where it broke a limit.
60
+ */
61
+ export function _check_ashrae55_compliance(kwargs, warnings) {
62
+ const default_kwargs = { airspeed_control: true, v_param_name: "v" };
63
+ const params = { ...default_kwargs, ...kwargs };
64
+ const v_param_name = params.v_param_name;
65
+ const values_to_return = {};
66
+ const tdb_valid = _valid_range(params.tdb, ASHRAE_55_LIMITS.tdb, "tdb", "input", "°C", warnings);
67
+ const tr_valid = _valid_range(params.tr, ASHRAE_55_LIMITS.tr, "tr", "input", "°C", warnings);
68
+ values_to_return.tdb = tdb_valid;
69
+ values_to_return.tr = tr_valid;
70
+ let v_valid = NaN;
71
+ if (params.v !== undefined) {
72
+ v_valid = _valid_range(params.v, ASHRAE_55_LIMITS.v, v_param_name, "input", "m/s", warnings);
73
+ values_to_return.v = v_valid;
74
+ }
75
+ // Ashrae55Kwargs gives v, met and clo wherever airspeed_control can be
76
+ // false; the checks on v and met only narrow the types.
77
+ if (!params.airspeed_control &&
78
+ params.v !== undefined &&
79
+ params.met !== undefined) {
80
+ const { v, met, clo } = params;
81
+ const exceeding = (bound) => {
82
+ warnings.push(Object.freeze({
83
+ kind: "range",
84
+ key: v_param_name,
85
+ role: "input",
86
+ value: v,
87
+ unit: "m/s",
88
+ bound,
89
+ }));
90
+ };
91
+ const cond1 = v > ASHRAE_55_AIRSPEED_NO_CONTROL.any.max && clo < 0.7 && met < 1.3;
92
+ if (cond1)
93
+ exceeding(ASHRAE_55_AIRSPEED_NO_CONTROL.any);
94
+ v_valid = cond1 ? NaN : v_valid;
95
+ const to = operative_tmp(params.tdb, params.tr, v);
96
+ const v_limit = 50.49 - 4.4047 * to + 0.096425 * to * to;
97
+ const cond2 = to > 23 && to < 25.5 && v > v_limit && clo < 0.7 && met < 1.3;
98
+ if (cond2)
99
+ exceeding(Object.freeze({ max: v_limit }));
100
+ v_valid = cond2 ? NaN : v_valid;
101
+ const cond3 = to <= 23 &&
102
+ v > ASHRAE_55_AIRSPEED_NO_CONTROL.cool.max &&
103
+ clo < 0.7 &&
104
+ met < 1.3;
105
+ if (cond3)
106
+ exceeding(ASHRAE_55_AIRSPEED_NO_CONTROL.cool);
107
+ v_valid = cond3 ? NaN : v_valid;
108
+ values_to_return.v = v_valid;
109
+ }
110
+ if (params.met !== undefined) {
111
+ const met_valid = _valid_range(params.met, ASHRAE_55_LIMITS.met, "met", "input", "met", warnings);
112
+ const clo_valid = _valid_range(params.clo, ASHRAE_55_LIMITS.clo, "clo", "input", "clo", warnings);
113
+ values_to_return.met = met_valid;
114
+ values_to_return.clo = clo_valid;
115
+ }
116
+ if (params.v_limited !== undefined) {
117
+ const valid = _valid_range(params.v_limited, ASHRAE_55_LIMITS.v_limited, "v_limited", "input", "m/s", warnings);
118
+ values_to_return.v_limited = valid;
119
+ }
120
+ return Object.values(values_to_return);
121
+ }
@@ -0,0 +1,216 @@
1
+ // A line-by-line port of scipy 1.18.1's `scipy.optimize.brentq` (ADR 0026).
2
+ //
3
+ // Copyright (c) 2001-2002 Enthought, Inc. 2003, SciPy Developers.
4
+ // All rights reserved.
5
+ //
6
+ // Redistribution and use in source and binary forms, with or without
7
+ // modification, are permitted provided that the following conditions
8
+ // are met:
9
+ //
10
+ // 1. Redistributions of source code must retain the above copyright
11
+ // notice, this list of conditions and the following disclaimer.
12
+ //
13
+ // 2. Redistributions in binary form must reproduce the above
14
+ // copyright notice, this list of conditions and the following
15
+ // disclaimer in the documentation and/or other materials provided
16
+ // with the distribution.
17
+ //
18
+ // 3. Neither the name of the copyright holder nor the names of its
19
+ // contributors may be used to endorse or promote products derived
20
+ // from this software without specific prior written permission.
21
+ //
22
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ import { notOfType } from "./errors.js";
34
+ const _iter = 100;
35
+ const _xtol = 2e-12;
36
+ const _rtol = 4 * Number.EPSILON;
37
+ /**
38
+ * Find a root of a function in a bracketing interval using Brent's method.
39
+ *
40
+ * The port of scipy's Python wrapper (`scipy/optimize/_zeros_py.py`, `brentq`
41
+ * and `_wrap_nan_raise`), its C caller (`scipy/optimize/_zerosmodule.c`,
42
+ * `call_solver`) and the solver (`scipy/optimize/Zeros/brentq.c`, written by
43
+ * Charles Harris). It takes the arguments upstream's callers pass: `args`,
44
+ * `full_output` and `disp` are left out, so a call that does not converge
45
+ * throws, as `disp=True` raises. scipy's `ValueError`s are `RangeError`s and
46
+ * its `RuntimeError` an `Error` (ADR 0022).
47
+ *
48
+ * @param f - The function, continuous, with `f(a)` and `f(b)` of opposite
49
+ * signs.
50
+ * @param a - One end of the bracketing interval `[a, b]`.
51
+ * @param b - The other end of the bracketing interval `[a, b]`.
52
+ * @param xtol - The absolute tolerance, positive.
53
+ * @param rtol - The relative tolerance, at least its default,
54
+ * `4 * Number.EPSILON`.
55
+ * @param maxiter - The most iterations, at least 0.
56
+ * @returns The root of `f` between `a` and `b`.
57
+ * @throws `TypeError` for a `maxiter` that is not an integer; `RangeError` for
58
+ * a tolerance or `maxiter` out of range, for `f(a)`
59
+ * and `f(b)` of the same sign, and for a NaN value of `f`; `Error` when
60
+ * `maxiter` iterations do not converge.
61
+ */
62
+ export function brentq(f, a, b, xtol = _xtol, rtol = _rtol, maxiter = _iter) {
63
+ // _zeros_py.py brentq, whose operator.index raises TypeError for a non-integer
64
+ if (!Number.isInteger(maxiter))
65
+ throw notOfType("maxiter", "an integer");
66
+ if (xtol <= 0) {
67
+ throw new RangeError(`xtol too small (${xtol} <= 0)`);
68
+ }
69
+ if (rtol < _rtol) {
70
+ throw new RangeError(`rtol too small (${rtol} < 8.88178e-16)`);
71
+ }
72
+ f = _wrap_nan_raise(f);
73
+ // _zerosmodule.c call_solver, whose `xtol < 0` check the one above makes
74
+ // unreachable
75
+ if (maxiter < 0) {
76
+ throw new RangeError("maxiter must be >= 0");
77
+ }
78
+ const [zero, error_num, iterations] = _brentq(f, a, b, xtol, rtol, maxiter);
79
+ if (error_num === SIGNERR) {
80
+ throw new RangeError("f(a) and f(b) must have different signs");
81
+ }
82
+ if (error_num === CONVERR) {
83
+ throw new Error(`Failed to converge after ${iterations} iterations.`);
84
+ }
85
+ return zero;
86
+ }
87
+ function _wrap_nan_raise(f) {
88
+ function f_raise(x) {
89
+ const fx = f(x);
90
+ if (Number.isNaN(fx)) {
91
+ const msg = `The function value at x=${x} is NaN; solver cannot continue.`;
92
+ throw new RangeError(msg);
93
+ }
94
+ return fx;
95
+ }
96
+ return f_raise;
97
+ }
98
+ const CONVERGED = 0;
99
+ const SIGNERR = -1;
100
+ const CONVERR = -2;
101
+ /*
102
+ At the top of the loop the situation is the following:
103
+
104
+ 1. the root is bracketed between xa and xb
105
+ 2. xa is the most recent estimate
106
+ 3. xp is the previous estimate
107
+ 4. |fp| < |fb|
108
+
109
+ The order of xa and xp doesn't matter, but assume xp < xb. Then xa lies to
110
+ the right of xp and the assumption is that xa is increasing towards the root.
111
+ In this situation we will attempt quadratic extrapolation as long as the
112
+ condition
113
+
114
+ * |fa| < |fp| < |fb|
115
+
116
+ is satisfied. That is, the function value is decreasing as we go along.
117
+ Note the 4 above implies that the right inequlity already holds.
118
+
119
+ The first check is that xa is still to the left of the root. If not, xb is
120
+ replaced by xp and the interval reverses, with xb < xa. In this situation
121
+ we will try linear interpolation. That this has happened is signaled by the
122
+ equality xb == xp;
123
+
124
+ The second check is that |fa| < |fb|. If this is not the case, we swap
125
+ xa and xb and resort to bisection.
126
+
127
+ */
128
+ function _brentq(f, xa, xb, xtol, rtol, iter) {
129
+ let xpre = xa, xcur = xb;
130
+ let xblk = 0, fpre, fcur, fblk = 0, spre = 0, scur = 0, sbis;
131
+ /* the tolerance is 2*delta */
132
+ let delta;
133
+ let stry, dpre, dblk;
134
+ let i;
135
+ let iterations = 0;
136
+ fpre = f(xpre);
137
+ fcur = f(xcur);
138
+ if (fpre === 0) {
139
+ return [xpre, CONVERGED, iterations];
140
+ }
141
+ if (fcur === 0) {
142
+ return [xcur, CONVERGED, iterations];
143
+ }
144
+ if (signbit(fpre) === signbit(fcur)) {
145
+ return [0, SIGNERR, iterations];
146
+ }
147
+ for (i = 0; i < iter; i++) {
148
+ iterations++;
149
+ if (fpre !== 0 && fcur !== 0 && signbit(fpre) !== signbit(fcur)) {
150
+ xblk = xpre;
151
+ fblk = fpre;
152
+ spre = scur = xcur - xpre;
153
+ }
154
+ if (Math.abs(fblk) < Math.abs(fcur)) {
155
+ xpre = xcur;
156
+ xcur = xblk;
157
+ xblk = xpre;
158
+ fpre = fcur;
159
+ fcur = fblk;
160
+ fblk = fpre;
161
+ }
162
+ delta = (xtol + rtol * Math.abs(xcur)) / 2;
163
+ sbis = (xblk - xcur) / 2;
164
+ if (fcur === 0 || Math.abs(sbis) < delta) {
165
+ return [xcur, CONVERGED, iterations];
166
+ }
167
+ if (Math.abs(spre) > delta && Math.abs(fcur) < Math.abs(fpre)) {
168
+ if (xpre === xblk) {
169
+ /* interpolate */
170
+ stry = (-fcur * (xcur - xpre)) / (fcur - fpre);
171
+ }
172
+ else {
173
+ /* extrapolate */
174
+ dpre = (fpre - fcur) / (xpre - xcur);
175
+ dblk = (fblk - fcur) / (xblk - xcur);
176
+ stry =
177
+ (-fcur * (fblk * dblk - fpre * dpre)) / (dblk * dpre * (fblk - fpre));
178
+ }
179
+ if (2 * Math.abs(stry) <
180
+ min(Math.abs(spre), 3 * Math.abs(sbis) - delta)) {
181
+ /* good short step */
182
+ spre = scur;
183
+ scur = stry;
184
+ }
185
+ else {
186
+ /* bisect */
187
+ spre = sbis;
188
+ scur = sbis;
189
+ }
190
+ }
191
+ else {
192
+ /* bisect */
193
+ spre = sbis;
194
+ scur = sbis;
195
+ }
196
+ xpre = xcur;
197
+ fpre = fcur;
198
+ if (Math.abs(scur) > delta) {
199
+ xcur += scur;
200
+ }
201
+ else {
202
+ xcur += sbis > 0 ? delta : -delta;
203
+ }
204
+ fcur = f(xcur);
205
+ }
206
+ return [xcur, CONVERR, iterations];
207
+ }
208
+ // C's `MIN(a, b)` macro, `((a) < (b) ? (a) : (b))`, which returns `b` where
209
+ // `Math.min` returns NaN.
210
+ function min(a, b) {
211
+ return a < b ? a : b;
212
+ }
213
+ // C's `signbit`, true for -0 too; `f_raise` has rejected NaN.
214
+ function signbit(x) {
215
+ return x < 0 || Object.is(x, -0);
216
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Classifies a value into bins, matching numpy's `digitize`.
3
+ *
4
+ * Given a value and a set of bin edges with corresponding labels, returns the
5
+ * label of the bin that contains the value:
6
+ *
7
+ * - `right: false` (left-inclusive): the bins are `[edges[i-1], edges[i])`.
8
+ * It returns `labels[0]` if `value < edges[0]`, `labels[1]` if
9
+ * `edges[0] <= value < edges[1]`, and so on, and NaN if
10
+ * `value >= edges[-1]`.
11
+ * - `right: true` (right-inclusive): the bins are `(edges[i-1], edges[i]]`.
12
+ * It returns `labels[0]` if `value <= edges[0]`, `labels[1]` if
13
+ * `edges[0] < value <= edges[1]`, and so on, and NaN if
14
+ * `value > edges[-1]`.
15
+ *
16
+ * As with `digitize`, NaN returns NaN, -Infinity falls into the first bin and
17
+ * +Infinity is beyond the last.
18
+ *
19
+ * Unlike `digitize`, which also takes decreasing edges, it throws unless the
20
+ * edges are strictly increasing (deviation _shared-2).
21
+ *
22
+ * @param value - The value to classify.
23
+ * @param bins - The bin configuration: strictly increasing `edges`, one
24
+ * `label` per bin, and `right` selecting right-inclusive (`value <= edge`) or
25
+ * left-inclusive (`value < edge`) bins. Typed readonly, so the frozen
26
+ * constants this library publishes can be passed straight in.
27
+ * @returns The label of the bin containing `value`, or NaN if `value` is
28
+ * outside all bins.
29
+ * @throws `RangeError` if the edges are not strictly increasing.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const bins = {
34
+ * edges: [0, 10, 20],
35
+ * labels: ["low", "medium", "high"],
36
+ * right: false,
37
+ * };
38
+ * classifyFromBins(-5, bins); // "low" (value < 0)
39
+ * classifyFromBins(5, bins); // "medium" (0 <= value < 10)
40
+ * classifyFromBins(15, bins); // "high" (10 <= value < 20)
41
+ * classifyFromBins(25, bins); // NaN (value >= 20)
42
+ * classifyFromBins(-Infinity, bins); // "low"
43
+ * classifyFromBins(Infinity, bins); // NaN
44
+ * ```
45
+ */
46
+ export function classifyFromBins(value, bins) {
47
+ const { edges, labels, right } = bins;
48
+ // The edges are checked before the value, so a bad table fails on every call
49
+ // rather than only on the values it would misclassify.
50
+ let previous;
51
+ for (const edge of edges) {
52
+ if (previous !== undefined && !(previous < edge)) {
53
+ throw new RangeError("edges must be strictly increasing.");
54
+ }
55
+ previous = edge;
56
+ }
57
+ // NaN, and +Infinity, which is beyond the last bin, give NaN; -Infinity falls
58
+ // into the first bin in both modes.
59
+ if (Number.isNaN(value) || value === Infinity)
60
+ return NaN;
61
+ if (value === -Infinity)
62
+ return labels[0] ?? NaN;
63
+ // The first edge the value is at or below (right-inclusive), or below
64
+ // (left-inclusive), names its bin; beyond the last edge there is none.
65
+ const index = edges.findIndex((edge) => right ? value <= edge : value < edge);
66
+ return index === -1 ? NaN : (labels[index] ?? NaN);
67
+ }