Open gulermelih opened 8 months ago
Python 3.11 and 3.12 are not yet supported in pythermalcomfort.
Thank you very much for reporting this issue. I have created a new virtual environment using Python 3.10 and then installed pythermalcomfort with this command:
pip install pythermalcomfort
This installs pythermalcomfort-2.8.4. However, I did not get any error after running the following code:
from pythermalcomfort.models import pmv_ppd
results = pmv_ppd(tdb=22, tr=22, vr=0.1, rh=60, met=1, clo=0.9, standard="ASHRAE")
print(results)
I created a virtual environment with Python 3.12 and I confirm that I also cannot install pythermalcomfort.
I created a virtual environment with Python 3.11 and I confirm that I am getting the same error as you.
I, therefore, suggest that you use Python 3.10 while I find a solution to the problem. I hope this works for you and this is not causing too many issues.
I believe I was able to fix this issue and in the future pythermalcomfort should be compatible with version 3.11. I am tagging @AkihisaNomoto who wrote the dataclass code.
Aki, I fixed the issue by changing the code as follows:
from typing import ClassVar
import numpy as np
@dataclass(frozen=True)
class Default:
# Body information
height: float = 1.72 # [m]
weight: float = 74.43 # [kg]
age: int = 20 # [-]
body_fat: float = 15 # [%]
cardiac_index: float = 2.59 # [L/min/m2]
blood_flow_rate: int = 290 # [L/h]
physical_activity_ratio: float = 1.25 # [-]
metabolic_rate: float = 1.0 # [met]
sex: str = "male"
posture: str = "standing"
bmr_equation: str = "harris-benedict"
bsa_equation: str = "dubois"
local_bsa: ClassVar[list[float]] = np.array(
[
0.110,
0.029,
0.175,
0.161,
0.221,
0.096,
0.063,
0.050,
0.096,
0.063,
0.050,
0.209,
0.112,
0.056,
0.209,
0.112,
0.056,
]
)
# Environment information
core_temperature: float = 37 # [°C]
skin_temperature: float = 34 # [°C]
other_body_temperature: float = 36 # [°C]
dry_bulb_air_temperature: float = 28.8 # [°C]
mean_radiant_temperature: float = 28.8 # [°C]
relative_humidity: float = 50 # [%]
air_speed: float = 0.1 # [m/s]
# Clothing information
clothing_insulation: float = 0 # [clo]
clothing_vapor_permeation_efficiency: float = 0.45 # [-]
lewis_rate = 16.5 # [K/kPa]
Hi. This is my first comment. I'm not sure if I'm posting in the right place. I apologize in advance if I'm making a mistake.
When I run below code (or any code with pythermalcomfort)
I got the below output;
When pythermalcomfort version is 2.8.4 or 2.8.3 this error occurs. 2.8.2 and 2.8.1 no issue.
Desktop
Normally, I was using version pythermalcomfort 2.8.1, but when I looked to check for the latest updates and installed the new version, I encountered this error. The latest version where I do not get any errors is 2.8.2.
Additionally, if you are using Python 3.12.0 version, pythermalcomfort is not installed. This is a different error. I removed python 3.12.0 and install 3.11.6. This is a completely independent and different error from above, I just mentioned it as additional information.