vector._compute.spatial package

Contents

vector._compute.spatial package#

Compute functions for spatial vectors, which is to say 3D and 4D.

Each function is a module with variants for each coordinate system (or combination of coordinate systems) as functions within the module.

Each module has a dispatch_map (dict) that maps coordinate types to the appropriate function and its return type(s), and a dispatch (function) uses this information to call the right function and return the right type.

The compute functions themselves are restricted to a minimum of Python features: no statements other than assignments and one return, no assumptions about data types. In particular, if statements and loops are not allowed. The tests/test_compute_features.py suite ensures that these rules are followed (though that set of allowed features can be expanded if it doesn’t prevent the addition of new backends).

Submodules#