Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f243ced
Changed default value of srad parameter in all solar heating power to…
ecieren Apr 1, 2025
fa5730e
Changed default value of srad parameter in all base solar heating pow…
ecieren Apr 1, 2025
b79c976
Changed some var names to more readable, private values
ecieren Apr 1, 2025
d960b77
Added solar irradiance (srad) to Solver.args; updated comments
ecieren Apr 1, 2025
2ba2a50
Renamed function with more explicit name; updated test
ecieren Apr 1, 2025
86ab48a
Changed max_len/exten/compress methods in Solver class; updated tests
ecieren Apr 1, 2025
b6700b8
Fixed typo/error in set_times method; updated tests
ecieren Apr 1, 2025
b14a53b
Changed reshape function to be more restrictive; updated tests
ecieren Apr 1, 2025
442e3ae
Factorized some code for steady temperature methods.
ecieren Apr 1, 2025
fb8342c
Reordered methods; added some type hints.
ecieren Apr 1, 2025
799f66e
Reordered methods; moved check_target out of class scope.
ecieren Apr 1, 2025
047fa2b
Added dynamic parameter to transient temperature methods; factorized …
ecieren Apr 1, 2025
bcc171c
Updated tests.
ecieren Apr 1, 2025
cfa9b1b
Updated tests.
ecieren Apr 1, 2025
1e7ef39
Changed default value of srad parameter in all solar heating power to…
ecieren Apr 1, 2025
9001b13
Changed default value of srad parameter in all base solar heating pow…
ecieren Apr 1, 2025
566c4b6
Changed some var names to more readable, private values
ecieren Apr 1, 2025
4aa8fe0
Added solar irradiance (srad) to Solver.args; updated comments
ecieren Apr 1, 2025
07577e1
Renamed function with more explicit name; updated test
ecieren Apr 1, 2025
fe8ed37
Changed max_len/exten/compress methods in Solver class; updated tests
ecieren Apr 1, 2025
1eabed4
Fixed typo/error in set_times method; updated tests
ecieren Apr 1, 2025
eba5096
Changed reshape function to be more restrictive; updated tests
ecieren Apr 1, 2025
ecb17be
Factorized some code for steady temperature methods.
ecieren Apr 1, 2025
ff9c31e
Reordered methods; added some type hints.
ecieren Apr 1, 2025
5762a0f
Reordered methods; moved check_target out of class scope.
ecieren Apr 1, 2025
f18f2f5
Added dynamic parameter to transient temperature methods; factorized …
ecieren Apr 1, 2025
71da5b7
Updated tests.
ecieren Apr 1, 2025
59d6ef4
Updated tests.
ecieren Apr 1, 2025
9958da3
Merge branch 'feeature/#28/transient-temperature-time-depending-param…
ecieren Apr 1, 2025
c04de7d
Updated sonar properties
ecieren Apr 1, 2025
69922ab
Changed default value of srad parameter in all solar heating power to…
ecieren Apr 1, 2025
6e4ccf8
Changed default value of srad parameter in all base solar heating pow…
ecieren Apr 1, 2025
4f5ece3
Changed some var names to more readable, private values
ecieren Apr 1, 2025
8966b3f
Added solar irradiance (srad) to Solver.args; updated comments
ecieren Apr 1, 2025
5682553
Renamed function with more explicit name; updated test
ecieren Apr 1, 2025
8c13dee
Changed max_len/exten/compress methods in Solver class; updated tests
ecieren Apr 1, 2025
a6a74c5
Fixed typo/error in set_times method; updated tests
ecieren Apr 1, 2025
60c0ad7
Changed reshape function to be more restrictive; updated tests
ecieren Apr 1, 2025
bdc1d61
Factorized some code for steady temperature methods.
ecieren Apr 1, 2025
56c8137
Reordered methods; added some type hints.
ecieren Apr 1, 2025
cc098ec
Reordered methods; moved check_target out of class scope.
ecieren Apr 1, 2025
6d98323
Added dynamic parameter to transient temperature methods; factorized …
ecieren Apr 1, 2025
bfcb50f
Updated tests.
ecieren Apr 1, 2025
b80e1b4
Updated tests.
ecieren Apr 1, 2025
e3110af
Changed max_len/exten/compress methods in Solver class; updated tests
ecieren Apr 1, 2025
98459de
Added dynamic parameter to transient temperature methods; factorized …
ecieren Apr 1, 2025
ac92ab6
Merge branch 'feeature/#28/transient-temperature-time-depending-param…
ecieren Apr 1, 2025
0f673b6
updated env name
ecieren Apr 2, 2025
1aa55f0
Update sonar-project.properties
ecieren Apr 2, 2025
4f7f602
Merge remote-tracking branch 'origin/main' into feeature/#28/transien…
ecieren Apr 15, 2025
e0cbe7c
Merge branch 'phlowers:main' into main
ecieren May 5, 2025
ad5e7fe
Merge branch 'phlowers:main' into feeature/#28/transient-temperature-…
ecieren May 5, 2025
4360bc9
Formatting (including imports)
ecieren May 5, 2025
a28ebb7
Merge branch 'phlowers:main' into main
ecieren May 19, 2025
05af38f
Merge remote-tracking branch 'origin/main' into feeature/#28/transien…
ecieren May 19, 2025
285b9d7
fix test
ecieren May 19, 2025
b4501b3
Formatting (including imports)
ecieren May 19, 2025
63ff74e
Merge remote-tracking branch 'upstream/main'
ecieren Jun 20, 2025
0043516
Merge from phlowers
ecieren Jun 20, 2025
8136a03
corrections for merge
ecieren Jun 23, 2025
5168228
updated 3t model for transient temperature
ecieren Jun 23, 2025
221c835
black formater
ecieren Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/create_env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV_DIR=/home/${USER}/ENV
mkdir -p $ENV_DIR

# -- current env with link
VENV=${ENV_DIR}/thermohl
VENV=${ENV_DIR}/ecieren-thermohl
VLNK=.venv
ln -sf $VENV $VLNK
python3 -m venv $VENV
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ sonar.sources=src/
sonar.tests=test/

sonar.python.version=3.9,3.10,3.11
sonar.python.coverage.reportPaths=coverage.xml
sonar.python.coverage.reportPaths=coverage.xml
3 changes: 1 addition & 2 deletions src/thermohl/power/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0

from .radiative_cooling import RadiativeCoolingBase

from .power_term import PowerTerm
from .radiative_cooling import RadiativeCoolingBase
from .solar_heating import _SRad, SolarHeatingBase
2 changes: 1 addition & 1 deletion src/thermohl/power/cigre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

from .air import Air
from .solar_heating import SolarHeating
from .convective_cooling import ConvectiveCooling
from .joule_heating import JouleHeating
from .radiative_cooling import RadiativeCooling
from .solar_heating import SolarHeating
9 changes: 5 additions & 4 deletions src/thermohl/power/cigre/solar_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
hour: floatArrayLike,
D: floatArrayLike,
alpha: floatArrayLike,
srad: Optional[floatArrayLike] = None,
srad: Optional[floatArrayLike] = float("nan"),
**kwargs: Any,
):
r"""Init with args.
Expand All @@ -74,8 +74,9 @@ def __init__(
external diameter.
alpha : float or np.ndarray
Solar absorption coefficient.
srad : xxx
xxx.
srad : float or np.ndarray
Solar irradiance. Default is nan. If nan value is estimated using
all other input.


Returns
Expand All @@ -85,7 +86,7 @@ def __init__(

"""
self.alpha = alpha
if srad is None:
if np.all(np.isnan(srad)):
self.srad = SolarHeating._solar_radiation(
np.deg2rad(lat), np.deg2rad(azm), al, month, day, hour
)
Expand Down
1 change: 0 additions & 1 deletion src/thermohl/power/ieee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from .air import Air
from .convective_cooling import ConvectiveCooling
from ..convective_cooling import ConvectiveCoolingBase
from .joule_heating import JouleHeating
from .radiative_cooling import RadiativeCooling
from .solar_heating import SolarHeating
1 change: 0 additions & 1 deletion src/thermohl/power/ieee/convective_cooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from typing import Any


from thermohl import floatArrayLike
from thermohl.power.convective_cooling import ConvectiveCoolingBase
from thermohl.power.ieee import Air
Expand Down
8 changes: 4 additions & 4 deletions src/thermohl/power/ieee/solar_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from typing import Optional, Any


from thermohl import floatArrayLike, intArrayLike
from thermohl.power import _SRad, SolarHeatingBase

Expand All @@ -24,7 +23,7 @@ def __init__(
hour: floatArrayLike,
D: floatArrayLike,
alpha: floatArrayLike,
srad: Optional[floatArrayLike] = None,
srad: Optional[floatArrayLike] = float("nan"),
**kwargs: Any,
):
r"""Init with args.
Expand Down Expand Up @@ -52,8 +51,9 @@ def __init__(
external diameter.
alpha : float or np.ndarray
Solar absorption coefficient.
srad : xxx
xxx
srad : float or np.ndarray
Solar irradiance. Default is nan. If nan value is estimated using
all other input.

Returns
-------
Expand Down
5 changes: 2 additions & 3 deletions src/thermohl/power/olla/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0

"""Power terms implementation using RTE's olla project choices.
"""
"""Power terms implementation using RTE's olla project choices."""

from .air import Air
from .solar_heating import SolarHeating
from .convective_cooling import ConvectiveCooling
from .joule_heating import JouleHeating
from .radiative_cooling import RadiativeCooling
from .solar_heating import SolarHeating
11 changes: 6 additions & 5 deletions src/thermohl/power/olla/solar_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from typing import Optional, Any

from thermohl.power import ieee
from thermohl import floatArrayLike, intArrayLike
from thermohl.power import ieee


class SolarHeating(ieee.SolarHeating):
Expand All @@ -24,7 +24,7 @@ def __init__(
hour: floatArrayLike,
D: floatArrayLike,
alpha: floatArrayLike,
srad: Optional[floatArrayLike] = None,
srad: Optional[floatArrayLike] = float("nan"),
**kwargs: Any,
):
r"""Init with args.
Expand All @@ -38,7 +38,7 @@ def __init__(
lat : float or np.ndarray
Latitude.
alt : float or np.ndarray
Lltitude.
Longitude.
azm : float or np.ndarray
Azimuth.
month : int or np.ndarray
Expand All @@ -52,8 +52,9 @@ def __init__(
external diameter.
alpha : float or np.ndarray
Solar absorption coefficient.
srad : xxx
xxx
srad : float or np.ndarray
Solar irradiance. Default is nan. If nan value is estimated using
all other input.

Returns
-------
Expand Down
3 changes: 1 addition & 2 deletions src/thermohl/power/rte/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0

"""Power terms implementation matching rte's Excel sheet.
"""
"""Power terms implementation matching rte's Excel sheet."""

from .air import Air
from .solar_heating import SolarHeating, solar_irradiance
Expand Down
2 changes: 1 addition & 1 deletion src/thermohl/power/rte/convective_cooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import numpy as np

from thermohl import floatArrayLike
from thermohl.power.rte import Air
from thermohl.power.convective_cooling import ConvectiveCoolingBase
from thermohl.power.rte import Air


class ConvectiveCooling(ConvectiveCoolingBase):
Expand Down
7 changes: 4 additions & 3 deletions src/thermohl/power/rte/solar_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(
hour: floatArrayLike,
D: floatArrayLike,
alpha: floatArrayLike,
srad: Optional[floatArrayLike] = None,
srad: Optional[floatArrayLike] = float("nan"),
**kwargs: Any,
):
r"""Build with args.
Expand All @@ -90,8 +90,9 @@ def __init__(
external diameter.
alpha : np.ndarray
Solar absorption coefficient.
srad : xxx
xxx
srad : float or np.ndarray
Solar irradiance. Default is nan. If nan value is estimated using
all other input.

Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions src/thermohl/power/solar_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ def __init__(
D: floatArrayLike,
alpha: floatArrayLike,
est: _SRad,
srad: Optional[floatArrayLike] = None,
srad: Optional[floatArrayLike] = float("nan"),
**kwargs: Any,
):
self.alpha = alpha
if srad is None:
if np.all(np.isnan(srad)):
self.srad = est(np.deg2rad(lat), alt, np.deg2rad(azm), tb, month, day, hour)
else:
self.srad = np.maximum(srad, 0.0)
Expand Down
45 changes: 23 additions & 22 deletions src/thermohl/solver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@

from typing import Dict, Any, Optional, Union, Type

from thermohl.power import cigre as cigrep
from thermohl.power import rte as rtep
from thermohl.power import ieee as ieeep
from thermohl.power import olla as ollap

from thermohl.power import cigre as _cigre
from thermohl.power import ieee as _ieee
from thermohl.power import olla as _olla
from thermohl.power import rte as _rte
from thermohl.solver.base import Args, Solver
from thermohl.solver.slv1d import Solver1D
from thermohl.solver.slv1t import Solver1T
from thermohl.solver.slv3t import Solver3T
from thermohl.solver.slv3t_legacy import Solver3TL

concreteSolverType = Union[Type[Solver1T], Type[Solver3T], Type[Solver3TL], Type[Solver1D]]
concreteSolverType = Union[
Type[Solver1T], Type[Solver3T], Type[Solver3TL], Type[Solver1D]
]


def default_values() -> Dict[str, Any]:
Expand All @@ -45,34 +46,34 @@ def _factory(
if model == "cigre":
return solver(
dic,
cigrep.JouleHeating,
cigrep.SolarHeating,
cigrep.ConvectiveCooling,
cigrep.RadiativeCooling,
_cigre.JouleHeating,
_cigre.SolarHeating,
_cigre.ConvectiveCooling,
_cigre.RadiativeCooling,
)
elif model == "ieee":
return solver(
dic,
ieeep.JouleHeating,
ieeep.SolarHeating,
ieeep.ConvectiveCooling,
ieeep.RadiativeCooling,
_ieee.JouleHeating,
_ieee.SolarHeating,
_ieee.ConvectiveCooling,
_ieee.RadiativeCooling,
)
elif model == "olla":
return solver(
dic,
ollap.JouleHeating,
ollap.SolarHeating,
ollap.ConvectiveCooling,
ollap.RadiativeCooling,
_olla.JouleHeating,
_olla.SolarHeating,
_olla.ConvectiveCooling,
_olla.RadiativeCooling,
)
elif model == "rte":
return solver(
dic,
rtep.JouleHeating,
rtep.SolarHeating,
rtep.ConvectiveCooling,
rtep.RadiativeCooling,
_rte.JouleHeating,
_rte.SolarHeating,
_rte.ConvectiveCooling,
_rte.RadiativeCooling,
)
else:
raise ValueError()
Expand Down
Loading