field_factory module

Define a factory to easily create the Field objects.

Todo

Implement SuperposedFieldMap.

class FieldFactory(default_field_map_folder)[source]

Bases: object

Create the Field and load the field maps.

Parameters:

default_field_map_folder (Path)

default_field_map_folder: Path
_gather_files_to_load(field_maps)[source]

Associate FieldMap objects using the same fields.

Parameters:

field_maps (Collection[FieldMap]) – All the FieldMap instances requiring a Field.

Returns:

A dictionary where each key is a path to a field map file, and each value is a list of FieldMap instances that use that file.

Return type:

dict[pathlib.Path, list[FieldMap]]

Raises:

NotImplementedError – If a SuperposedFieldMap is encountered, as it’s not yet supported.

_check_uniformity_of_types(to_load)[source]

Check that for a file name, all corresp. object have same geom.

Parameters:

to_load (dict[Path, list[FieldMap]])

Return type:

None

_run(constructor, field_map_path, length_m, z_0=0.0, **kwargs)[source]

Create a single Field.

Parameters:
Return type:

Field

_run_kwargs(field_map)[source]

Get the kwargs necessary for _run.

Parameters:

field_map (FieldMap)

Return type:

dict[str, Any]

run_all(field_maps)[source]

Generate the Field objects and store it in field maps.

Parameters:

field_maps (Collection[FieldMap])

Return type:

None

__init__(default_field_map_folder)
Parameters:

default_field_map_folder (Path)