base_range

class pyheatintegration.base_range.BaseRange(start: float, finish: float)

範囲を表すベースクラス。

パラメータ
  • start (float) -- 範囲の開始値。

  • finish (float) -- 範囲の終了値。

start

範囲の開始値。

Type

float

finish

範囲の終了値。

Type

float

delta

範囲の大きさ。

Type

float

mergeable(other: pyheatintegration.base_range.BaseRange) bool

結合可能かを返します。

パラメータ

other (BaseRange) -- 結合対象。

戻り値

結合可能であるかどうかを表すbool値。

サンプル

>>> base_range = BaseRange(0, 10)
>>> base_range.mergeable(BaseRange(10, 20))
True
>>> base_range.mergeable(BaseRange(5, 20))
False
shift(delta: float) None

範囲をずらします。

パラメータ

delta (float) -- ずらす値。

サンプル

>>> base_range = BaseRange(0, 10)
>>> base_range.shift(10)
>>> base_range.start
10
>>> base_range.finish
20
pyheatintegration.base_range.flatten(ranges_: list[~ T]) list[float]

領域を平坦化したリストを返します。

パラメータ

heat_ranges (list[T]) -- 領域のリスト。

戻り値

平坦化されたリスト。

戻り値の型

list[float]

例外

ValueError -- 領域が連続でない場合。

pyheatintegration.base_range.get_ranges(values: list[float], cls: type[~ T]) list[~T]

領域のリストを返します。

パラメータ
  • values (list[float]) -- 領域の開始値と終了値を構成する値のリスト。

  • cls (type[T]) -- 領域のクラス。HeatRange/TemperatureRange

戻り値

領域のリスト。

戻り値の型

list[T]

pyheatintegration.base_range.is_continuous(ranges_: list[~ T]) Optional[tuple[float, float]]

領域のリストが連続であるかを検証します。

パラメータ

ranges (list[T]) -- 領域のリスト。

戻り値

領域が連続である場合はNoneを返し、連続でない場合は、連続でないと判断された箇所の 値をタプルで返します。

戻り値の型

Optional[tuple[float, float]]

pyheatintegration.base_range.merge(range_: pyheatintegration.base_range.T, other: pyheatintegration.base_range.T) pyheatintegration.base_range.T

範囲を結合します。

パラメータ
  • range (T) -- 結合元。

  • other (T) -- 結合対象。

戻り値

結合後の範囲。

戻り値の型

T

例外
  • TypeError -- 結合元と結合対象の型が一致しない場合。

  • ValueError -- 結合可能ではない範囲が渡された場合。

pyheatintegration.base_range.minmax(a: float, b: float) tuple[float, float]