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.

enum pyfibers.model_enum.FiberModel(value)

An enumeration.

Valid values are as follows:

MRG_DISCRETE = <FiberModel.MRG_DISCRETE: <class 'pyfibers.models.mrg.MRGFiber'>>
MRG_INTERPOLATION = <FiberModel.MRG_INTERPOLATION: <class 'pyfibers.models.mrg.MRGFiber'>>
RATTAY = <FiberModel.RATTAY: <class 'pyfibers.models.rattay.RattayFiber'>>
SCHILD94 = <FiberModel.SCHILD94: <class 'pyfibers.models.schild.SchildFiber'>>
SCHILD97 = <FiberModel.SCHILD97: <class 'pyfibers.models.schild.SchildFiber'>>
SMALL_MRG_INTERPOLATION = <FiberModel.SMALL_MRG_INTERPOLATION: <class 'pyfibers.models.mrg.MRGFiber'>>
SUNDT = <FiberModel.SUNDT: <class 'pyfibers.models.sundt.SundtFiber'>>
THIO_AUTONOMIC = <FiberModel.THIO_AUTONOMIC: <class 'pyfibers.models.thio.ThioFiber'>>
THIO_CUTANEOUS = <FiberModel.THIO_CUTANEOUS: <class 'pyfibers.models.thio.ThioFiber'>>
TIGERHOLM = <FiberModel.TIGERHOLM: <class 'pyfibers.models.tigerholm.TigerholmFiber'>>
pyfibers.model_enum.discover_plugins()

Discover plugin classes using entry points under the ‘pyfibers.fiber_plugins’ group.

This function looks for any package registering an entry point with the group ‘pyfibers.fiber_plugins’. Each plugin class must define a submodels attribute (list) that enumerates the specific fiber model(s) identifiers the plugin provides.

Raises:

ValueError – If a discovered plugin class does not contain a submodels attribute.

Return type:

dict[str, type]

Returns:

A dictionary mapping each submodel name (converted to uppercase) to the plugin class.