📄 ファイル操作
- class foamlib.FoamFile(path: PathLike[str] | str)
ベースクラス:
MutableMultiMapping[str|None, Data | StandaloneData | FoamFile.SubDict | None],PathLike[str],FoamFileIOOpenFOAMのデータファイル。
FoamFileは、正規表現や # ベースのディレクティブを含むものを含め、ほとんどの OpenFOAM のデータおよび設定ファイル(すなわち "FoamFile" ヘッダーを持つファイル)をサポートしています。主な例外は #codeStreams を含む FoamFile で、これは現在サポートされていません。また、このクラスは FoamFile 形式以外の出力ファイルもサポートしていません。正規表現や # ベースのディレクティブにはアクセスおよび編集が可能ですが、本ライブラリによってそれらが評価または展開されることはありません。FoamFileは可変マッピング(すなわちdictのようなオブジェクト)として使用でき、エントリへのアクセスや変更を行うことができます。サブディクショナリにアクセスすると、返される値はFoamFile.SubDictオブジェクトとなり、これを通じてFoamFile内の入れ子になったディクショナリを一度にアクセスおよび変更することができます。もし
FoamFileが辞書を保持していない場合、主要な格納値はNoneをキーとして渡すことでアクセスおよび変更できます(例:file[None])。FoamFileをコンテキストマネージャー(つまりwithブロック内)として使用することもできます。これにより、ファイルに対して複数の変更を行いながら、すべての変更を最後に一度だけ保存することができます。- パラメータ:
path -- ファイルへのパス。ファイルが存在しない場合でも、最初の変更が行われた時点で自動的に作成されます。ただし、存在しないファイル内のエントリにアクセスしようとした場合は、
FileNotFoundErrorが発生します。
使用例:
from foamlib import FoamFile file = FoamFile("path/to/case/system/controlDict") # Load a controlDict file print(file["endTime"]) # Print the end time file["writeInterval"] = 100 # Set the write interval to 100 file["writeFormat"] = "binary" # Set the write format to binary
または(より良い):
from foamlib import FoamCase case = FoamCase("path/to/case") with case.control_dict as file: # Load the controlDict file print(file["endTime"]) # Print the end time file["writeInterval"] = 100 file["writeFormat"] = "binary"
- property version: float
self["FoamFile"]["version"]の別名。
- property format: Literal['ascii', 'binary']
self["FoamFile"]["format"]の別名。
- property class_: str
self["FoamFile"]["class"]の別名。
- property location: str
self["FoamFile"]["location"]の別名。
- property object_: str
self["FoamFile"]["object"]の別名。
- __getitem__(keywords: str | tuple[str, Unpack[tuple[str, ...]]]) Data | FoamFile.SubDict | None
- __getitem__(keywords: None | tuple[()]) StandaloneData
Get the first value for a key.
Raises a KeyError if the key is not found.
- __setitem__(keywords: str | tuple[str, Unpack[tuple[str, ...]]], data: DataLike | SubDictLike | None) None
- __setitem__(keywords: None | tuple[()], data: StandaloneDataLike) None
- __setitem__(keywords: slice, data: FileDictLike) None
Set the value for a key.
If the key does not exist, it is added with the specified value.
If the key already exists, the first item is assigned the new value, and any other items with the same key are removed.
- __contains__(keywords: object) bool
Check if the FoamFile contains the given keyword or tuple of keywords.
- get(keywords: str | tuple[str, Unpack[tuple[str, ...]]], default: _D = None, /) Data | FoamFile.SubDict | None | _D
- get(keywords: None | tuple[()], default: _D = None, /) StandaloneData | _D
- getone(keywords: str | tuple[str, Unpack[tuple[str, ...]]], /) Data | FoamFile.SubDict | None
- getone(keywords: None | tuple[()], /) StandaloneData
Get the first value for a key.
Raises a KeyError if the key is not found and no default is provided.
- getall(keywords: str | tuple[str, Unpack[tuple[str, ...]]], /) Collection['Data | FoamFile.SubDict | None']
- getall(keywords: None | tuple[()], /) Collection[StandaloneData]
Get all values for a key.
Raises a KeyError if the key is not found and no default is provided.
- add(keywords: str | tuple[str, Unpack[tuple[str, ...]]], data: DataLike | SubDictLike | None) None
- add(keywords: None | tuple[()], data: StandaloneDataLike) None
Add a new value for a key.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D
- pop(key: _K, /) _V
Same as popone.
- popone(keywords: str | tuple[str, Unpack[tuple[str, ...]]], /) Data | SubDict | None
- popone(keywords: None | tuple[()], /) StandaloneData
Remove and return the first value for a key.
Raises a KeyError if the key is not found.
- popall(key: _K, /) Collection[_V]
Remove and return all values for a key.
Raises a KeyError if the key is not found and no default is provided.
- __len__() int
FoamFile 内のトップレベルのキーワードの数を返します(存在する場合は FoamFile ヘッダーを除きます)。
- __iter__() Iterator[str | None]
FoamFile 内のトップレベルキーを反復処理します(存在する場合は FoamFile ヘッダーを除きます)。
- keys(*, include_header: bool = False) KeysView
Return a collection of the keywords in the FoamFile.
- パラメータ:
include_header -- Whether to include the "FoamFile" header in the output.
- values(*, include_header: bool = False) ValuesView
Return a collection of the values in the FoamFile.
- パラメータ:
include_header -- Whether to include the "FoamFile" header in the output.
- items(*, include_header: bool = False) ItemsView
Return a collection of the items (keyword-value pairs) in the FoamFile.
- パラメータ:
include_header -- Whether to include the "FoamFile" header in the output.
- clear(include_header: bool = False) None
Remove all entries from the FoamFile.
- パラメータ:
include_header -- Whether to also remove the "FoamFile" header.
- update(other: SupportsKeysAndGetItem[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None] | Iterable[tuple[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None]] = (), /, **kwargs: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Update the multi-mapping with items from another object.
This replaces existing values for keys found in the other object.
- extend(other: SupportsKeysAndGetItem[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None] | Iterable[tuple[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None]] = (), /, **kwargs: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Extend the multi-mapping with items from another object.
- merge(other: SupportsKeysAndGetItem[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None] | Iterable[tuple[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None]] = (), /, **kwargs: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Merge another object into the multi-mapping.
Keys from other that already exist in the multi-mapping will not be replaced.
- as_dict(*, include_header: bool = False) dict[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], ...]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], ...]]] | dict[str, Data | SubDict | None] | MultiDict[str, Data | SubDict | None] | None] | MultiDict[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], ...]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], ...]]] | dict[str, Data | SubDict | None] | MultiDict[str, Data | SubDict | None] | None]
Return a nested dict representation of the file.
- パラメータ:
include_header -- Whether to include the "FoamFile" header in the output.
- __enter__() Self
Read the file from disk if not already read, and defer writing of changes until the context is exited.
- __exit__(exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None) None
If this is the outermost context, write any deferred file changes to disk.
- static loads(s: bytes | bytearray | str, *, include_header: bool = False) dict[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], ...]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], ...]]] | dict[str, Data | SubDict | None] | MultiDict[str, Data | SubDict | None] | None] | MultiDict[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], ...]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]], ...]]] | dict[str, Data | SubDict | None] | MultiDict[str, Data | SubDict | None] | None] | str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]], ...]]]
Standalone deserializing function.
Deserialize the OpenFOAM FoamFile format to Python objects.
- パラメータ:
s -- The string to deserialize. This can be a dictionary, list, or any other object that can be serialized to the OpenFOAM format.
include_header -- Whether to include the "FoamFile" header in the output. If True, the header will be included if it is present in the input object.
- static dumps(file: Mapping[str | None, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None] | str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | ndarray[tuple[int], dtype[int64 | int32 | float64]] | ndarray[tuple[int, Literal[3]], dtype[float64 | float32]] | list[ndarray[tuple[Literal[3, 4]], dtype[int64]]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | Sequence[int] | Sequence[float] | Sequence[ndarray[tuple[Literal[3]], dtype[floating]]] | Sequence[ndarray[tuple[Literal[3, 4]], dtype[integer]]] | Sequence[Sequence[int]], ...]]], *, ensure_header: bool = True) bytes
Standalone serializing function.
Serialize Python objects to the OpenFOAM FoamFile format.
- パラメータ:
file -- The Python object to serialize. This can be a dictionary, list, or any other object that can be serialized to the OpenFOAM format.
ensure_header -- Whether to include the "FoamFile" header in the output. If
True, a header will be included if it is not already present in the input object.
- class SubDict(_file: FoamFile, _keywords: tuple[str, Unpack[tuple[str, ...]]])
ベースクラス:
MutableMultiMapping[str, Data | FoamFile.SubDict | None]An OpenFOAM sub-dictionary within a file.
FoamFile.SubDictis a mutable mapping that allows for accessing and modifying nested dictionaries within aFoamFilein a single operation. It behaves like adictand can be used to access and modify entries in the sub-dictionary.To obtain a
FoamFile.SubDictobject, access a sub-dictionary in aFoamFileobject (e.g.,file["subDict"]).使用例:
from foamlib import FoamFile file = FoamFile("path/to/case/system/fvSchemes") # Load an fvSchemes file print(file["ddtSchemes"]["default"]) # Print the default ddt scheme file["ddtSchemes"]["default"] = "Euler" # Set the default ddt scheme
または(より良い):
from foamlib import FoamCase case = FoamCase("path/to/case") with case.fv_schemes as file: # Load the fvSchemes file print(file["ddtSchemes"]["default"]) file["ddtSchemes"]["default"] = "Euler"
- SubDict.__getitem__(keyword: str) Data | FoamFile.SubDict | None
Get the first value for a key.
Raises a KeyError if the key is not found.
- SubDict.__setitem__(keyword: str | slice, data: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Set the value for a key.
If the key does not exist, it is added with the specified value.
If the key already exists, the first item is assigned the new value, and any other items with the same key are removed.
- SubDict.__contains__(keyword: object) bool
- SubDict.get(k[, d]) D[k] if k in D, else d. d defaults to None.
- SubDict.getone(key: _K, /) _V
Get the first value for a key.
Raises a KeyError if the key is not found and no default is provided.
- SubDict.getall(keyword: str, /) Collection[Data | FoamFile.SubDict | None]
Get all values for a key.
Raises a KeyError if the key is not found and no default is provided.
- SubDict.add(keyword: str, data: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Add a new value for a key.
- SubDict.setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D
- SubDict.pop(key: _K, /) _V
Same as popone.
- SubDict.popone(keyword: str, /) Data | SubDict | None
Remove and return the first value for a key.
Raises a KeyError if the key is not found.
- SubDict.popall(key: _K, /) Collection[_V]
Remove and return all values for a key.
Raises a KeyError if the key is not found and no default is provided.
- SubDict.__len__() int
Return the total number of items (key-value pairs).
- SubDict.__iter__() Iterator[str]
Return an iterator over the keys.
Keys with multiple values will be yielded multiple times.
- SubDict.keys() KeysView
Return a view of the keys in the MultiMapping.
- SubDict.values() ValuesView
Return a view of the values in the MultiMapping.
- SubDict.items() ItemsView
Return a view of the items (key-value pairs) in the MultiMapping.
- SubDict.clear() None
Remove all items from the multi-mapping.
- SubDict.update(other: SupportsKeysAndGetItem[str, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None] | Iterable[tuple[str, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None]] = (), /, **kwargs: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Update the multi-mapping with items from another object.
This replaces existing values for keys found in the other object.
- SubDict.extend(other: SupportsKeysAndGetItem[str, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None] | Iterable[tuple[str, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None]] = (), /, **kwargs: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Extend the multi-mapping with items from another object.
- SubDict.merge(other: SupportsKeysAndGetItem[str, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None] | Iterable[tuple[str, str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None]] = (), /, **kwargs: str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]] | tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], Unpack[tuple[str | int | float | bool | Dimensioned | DimensionSet | list[DataEntry | KeywordEntry | Dict] | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]] | Integral | Real | Sequence[int | float] | Sequence[DataEntryLike | KeywordEntryLike | DictLike] | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]] | Sequence[float | ndarray[tuple[Literal[3, 6, 9]], dtype[float64]] | Real | Sequence[float | Real] | ndarray[tuple[Literal[3, 6, 9]], dtype[floating | integer]]], ...]]] | Mapping[str, DataLike | SubDictLike | None] | None) None
Merge another object into the multi-mapping.
Keys from other that already exist in the multi-mapping will not be replaced.
- class foamlib.FoamFile.Dimensioned
Alias of
Dimensionedprovided for backward compatibility.Prefer using
foamlib.Dimensioneddirectly.
- class foamlib.FoamFile.DimensionSet
Alias of
DimensionSetprovided for backward compatibility.Prefer using
foamlib.DimensionSetdirectly.
- class foamlib.FoamFieldFile(path: PathLike[str] | str)
ベースクラス:
FoamFileSubclass of
FoamFilefor representing OpenFOAM field files specifically.The difference between
FoamFieldFileandFoamFileis thatFoamFieldFilehas the additional propertiesdimensions,internal_field, andboundary_fieldthat are commonly found in OpenFOAM field files. Note that these are only a shorthand for accessing the corresponding entries in the file.See
FoamFilefor more information on how to read and edit OpenFOAM files.- パラメータ:
path -- ファイルへのパス。ファイルが存在しない場合でも、最初の変更が行われた時点で自動的に作成されます。ただし、存在しないファイル内のエントリにアクセスしようとした場合は、
FileNotFoundErrorが発生します。
使用例:
from foamlib import FoamFieldFile field = FoamFieldFile("path/to/case/0/U") # Load a field print(field.dimensions) # Print the dimensions print(field.boundary_field) # Print the boundary field field.internal_field = [0, 0, 0] # Set the internal field
または(より良い):
from foamlib import FoamCase case = FoamCase("path/to/case") with case[0]["U"] as field: # Load a field print(field.dimensions) print(field.boundary_field) field.internal_field = [0, 0, 0]
- property internal_field: float | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]]
self["internalField"]の別名。
- property boundary_field: BoundariesSubDict
self["boundaryField"]の別名。
- property dimensions: DimensionSet
self["dimensions"]の別名。
- class BoundariesSubDict(_file: FoamFile, _keywords: tuple[str, Unpack[tuple[str, ...]]])
ベースクラス:
SubDict
- class BoundarySubDict(_file: FoamFile, _keywords: tuple[str, Unpack[tuple[str, ...]]])
ベースクラス:
SubDictAn OpenFOAM dictionary representing a boundary condition as a mutable mapping.
- property BoundarySubDict.value: float | ndarray[tuple[int] | tuple[int, Literal[3, 6, 9]], dtype[floating]]
self["value"]の別名。
- property BoundarySubDict.type: str
self["type"]の別名。
Additional classes
- class foamlib.Dimensioned(value: TensorLike, dimensions: DimensionSetLike, name: str | None = None)
物理的次元を伴う数値。
Corresponds to the dimensioned<...> type in OpenFOAM.
The value can be a single number (scalar) or a 1D array (vector or tensor).
- パラメータ:
value -- The numerical value.
dimensions -- The physical dimensions as a
DimensionSetor a sequence of up to 7 numbers.name -- An optional name for the dimensioned quantity.
- class foamlib.DimensionSet(mass: int | float = 0, length: int | float = 0, time: int | float = 0, temperature: int | float = 0, moles: int | float = 0, current: int | float = 0, luminous_intensity: int | float = 0)
SI基本単位の累乗で表される物理的次元の集合。
Corresponds to the dimensionSet type in OpenFOAM.
- パラメータ:
mass -- Power of the mass dimension.
length -- Power of the length dimension.
time -- Power of the time dimension.
temperature -- Power of the temperature dimension.
moles -- Power of the amount of substance dimension.
current -- Power of the electric current dimension.
luminous_intensity -- Power of the luminous intensity dimension.
Exceptions
- class foamlib.FoamFileDecodeError(contents: bytes | bytearray, pos: int, *, expected: str)
Error raised when a FoamFile cannot be parsed.