field_factory module
Define a factory to easily create the Field objects.
Todo
Implement SuperposedFieldMap.
- class FieldFactory(default_field_map_folder: Path)
Bases:
objectCreate the
Fieldand load the field maps.- _gather_files_to_load(field_maps: Collection[FieldMap]) dict[Path, list[FieldMap]]
Associate
FieldMapobjects using the same fields.- Parameters:
field_maps (Collection[FieldMap]) – All the
FieldMapinstances requiring aField.- Returns:
A dictionary where each key is a path to a field map file, and each value is a list of
FieldMapinstances that use that file.- Return type:
- Raises:
NotImplementedError – If a
SuperposedFieldMapis encountered, as it’s not yet supported.
- _check_uniformity_of_types(to_load: dict[Path, list[FieldMap]]) None
Check that for a file name, all corresp. object have same geom.
- _run(constructor: type[Field], field_map_path: Path, length_m: float, z_0: float = 0.0, **kwargs) Field
Create a single
Field.
- run_all(field_maps: Collection[FieldMap]) None
Generate the
Fieldobjects and store it in field maps.