field_factory module

Define a factory to easily create the Field objects.

Todo

Implement SuperposedFieldMap.

class FieldFactory(default_field_map_folder, load_cython_field_maps=False)[source]

Bases: object

Create the Field and load the field maps.

Parameters:
  • default_field_map_folder (Path)

  • load_cython_field_maps (bool, default: False)

default_field_map_folder: Path
load_cython_field_maps: bool = False
__post_init__()[source]

Raise an error if Cython is asked.

Return type:

None

_gather_primary_files_to_load(field_maps)[source]

Associate FieldMap objects using the same fields.

SuperposedFieldMap are replaced by the list of FieldMap they superpose.

Parameters:

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

Return type:

dict[tuple[Path, str, float, float], list[FieldMap]]

Returns:

A dictionary where each key is the tuple of arguments to instantiate a Field, and value is the list of FieldMap that will share this object.

_check_uniformity_of_types(to_load)[source]

Check that for a file name, all corresp.

object have same geom.

Parameters:

to_load (dict[tuple[Path, str, float, float], list[FieldMap]])

Return type:

None

run_all(field_maps)[source]

Generate the Field objects and store it in field maps.

Parameters:

field_maps (Collection[FieldMap])

Return type:

None

_create_superposed(field_maps)[source]

Create SuperposedFieldMap from FieldMap.

Classic FieldMap remain untouched.

Parameters:

field_maps (Collection[FieldMap])

Return type:

None

__init__(default_field_map_folder, load_cython_field_maps=False)
Parameters:
  • default_field_map_folder (Path)

  • load_cython_field_maps (bool, default: False)

Return type:

None