FiberModel Enum

Note

Values listed for FiberModel below are the models included with PyFibers, and do not represent models added via plugins, or by users. To see all available fiber models print the enum members: [m.name for m in FiberModel].

Dynamically create an enum of all fiber models, including built-in and plugin models.

This module imports fiber model classes from the local models package, discovers additional plugin models via Python entry points, and aggregates all submodels into a single FiberModel enum. This allows users to refer to fiber models in a uniform way and makes it easier to extend the codebase with new fiber models or external plugins.

Classes:

FiberModel: A dynamically generated enum of fiber models.

pyfibers.model_enum.register_custom_fiber(fiber_class)

Register a custom fiber model class with the FiberModel enum at runtime.

This function allows users to dynamically add custom fiber models to the FiberModel enum without needing to modify the main package or create a plugin.

Parameters:

fiber_class (type) – The fiber model class to register. Must have a ‘submodels’ attribute.

Return type:

None