"""Define possible scale variations schemes.
A Mathematica snippet to check the formulas is available in the
extras folder.
"""
import enum
from . import expanded, exponentiated
[docs]
class Modes(enum.IntEnum):
"""Enumerate scale Variation modes."""
unvaried = enum.auto()
exponentiated = enum.auto()
expanded = enum.auto()
[docs]
def sv_mode(s):
"""Return the scale variation mode.
Parameters
----------
s : str
string representation
Returns
-------
enum.IntEnum
enum representation
"""
if s is not None:
return Modes[s.value]
return Modes.unvaried
[docs]
class ModeMixin:
"""Mixin to cast scale variation mode."""
@property
def sv_mode(self):
"""Return the scale variation mode."""
return sv_mode(self.config["ModSV"])