sas.sascalc package

Subpackages

Submodules

sas.sascalc.util module

class sas.sascalc.util.ExtrapolationInteractionState(extrapolation_parameters: ExtrapolationParameters, working_line_id: int | None = None, dragging_line_position: float | None = None)

Bases: object

Represents the state of the slider used to control extrapolation parameters

Contains extrapolation parameters along with the representation of the hover state.

__annotations__ = {'dragging_line_position': float | None, 'extrapolation_parameters': <class 'sas.sascalc.util.ExtrapolationParameters'>, 'working_line_id': int | None}
__dataclass_fields__ = {'dragging_line_position': Field(name='dragging_line_position',type=float | None,default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'extrapolation_parameters': Field(name='extrapolation_parameters',type=<class 'sas.sascalc.util.ExtrapolationParameters'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'working_line_id': Field(name='working_line_id',type=int | None,default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)
__dict__ = mappingproxy({'__module__': 'sas.sascalc.util', '__firstlineno__': 33, '__annotations__': {'extrapolation_parameters': <class 'sas.sascalc.util.ExtrapolationParameters'>, 'working_line_id': int | None, 'dragging_line_position': float | None}, '__doc__': 'Represents the state of the slider used to control extrapolation parameters\n\nContains extrapolation parameters along with the representation of the hover state.\n', 'working_line_id': None, 'dragging_line_position': None, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'ExtrapolationInteractionState' objects>, '__weakref__': <attribute '__weakref__' of 'ExtrapolationInteractionState' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'extrapolation_parameters': Field(name='extrapolation_parameters',type=<class 'sas.sascalc.util.ExtrapolationParameters'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'working_line_id': Field(name='working_line_id',type=int | None,default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'dragging_line_position': Field(name='dragging_line_position',type=float | None,default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__replace__': <function _replace>, '__hash__': None, '__init__': <function ExtrapolationInteractionState.__init__>, '__repr__': <function ExtrapolationInteractionState.__repr__>, '__eq__': <function ExtrapolationInteractionState.__eq__>, '__match_args__': ('extrapolation_parameters', 'working_line_id', 'dragging_line_position')})
__doc__ = 'Represents the state of the slider used to control extrapolation parameters\n\nContains extrapolation parameters along with the representation of the hover state.\n'
__eq__(other)

Return self==value.

__firstlineno__ = 33
__hash__ = None
__init__(extrapolation_parameters: ExtrapolationParameters, working_line_id: int | None = None, dragging_line_position: float | None = None) None
__match_args__ = ('extrapolation_parameters', 'working_line_id', 'dragging_line_position')
__module__ = 'sas.sascalc.util'
__replace__(**changes)
__repr__()

Return repr(self).

__static_attributes__ = ()
__weakref__

list of weak references to the object

dragging_line_position: float | None = None
extrapolation_parameters: ExtrapolationParameters
working_line_id: int | None = None
class sas.sascalc.util.ExtrapolationParameters(ex_q_min: float | None, data_q_min: float, point_1: float, point_2: float, point_3: float, data_q_max: float, ex_q_max: float | None)

Bases: NamedTuple

Represents the parameters defining extrapolation

__annotations__ = {'data_q_max': <class 'float'>, 'data_q_min': <class 'float'>, 'ex_q_max': float | None, 'ex_q_min': float | None, 'point_1': <class 'float'>, 'point_2': <class 'float'>, 'point_3': <class 'float'>}
__doc__ = 'Represents the parameters defining extrapolation'
__firstlineno__ = 22
__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

__match_args__ = ('ex_q_min', 'data_q_min', 'point_1', 'point_2', 'point_3', 'data_q_max', 'ex_q_max')
__module__ = 'sas.sascalc.util'
static __new__(_cls, ex_q_min: float | None, data_q_min: float, point_1: float, point_2: float, point_3: float, data_q_max: float, ex_q_max: float | None)

Create new instance of ExtrapolationParameters(ex_q_min, data_q_min, point_1, point_2, point_3, data_q_max, ex_q_max)

__orig_bases__ = (<function NamedTuple>,)
__replace__(**kwds)

Return a new ExtrapolationParameters object replacing specified fields with new values

__repr__()

Return a nicely formatted representation string

__slots__ = ()
__static_attributes__ = ()
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('ex_q_min', 'data_q_min', 'point_1', 'point_2', 'point_3', 'data_q_max', 'ex_q_max')
classmethod _make(iterable)

Make a new ExtrapolationParameters object from a sequence or iterable

_replace(**kwds)

Return a new ExtrapolationParameters object replacing specified fields with new values

data_q_max: float

Alias for field number 5

data_q_min: float

Alias for field number 1

ex_q_max: float | None

Alias for field number 6

ex_q_min: float | None

Alias for field number 0

point_1: float

Alias for field number 2

point_2: float

Alias for field number 3

point_3: float

Alias for field number 4

class sas.sascalc.util.SettableExtrapolationParameters(point_1: float, point_2: float, point_3: float)

Bases: object

Extrapolation parameters that can be set by the user

__annotations__ = {'point_1': <class 'float'>, 'point_2': <class 'float'>, 'point_3': <class 'float'>}
__dataclass_fields__ = {'point_1': Field(name='point_1',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'point_2': Field(name='point_2',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'point_3': Field(name='point_3',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)
__dict__ = mappingproxy({'__module__': 'sas.sascalc.util', '__firstlineno__': 14, '__annotations__': {'point_1': <class 'float'>, 'point_2': <class 'float'>, 'point_3': <class 'float'>}, '__doc__': 'Extrapolation parameters that can be set by the user', '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'SettableExtrapolationParameters' objects>, '__weakref__': <attribute '__weakref__' of 'SettableExtrapolationParameters' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'point_1': Field(name='point_1',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'point_2': Field(name='point_2',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'point_3': Field(name='point_3',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__replace__': <function _replace>, '__hash__': None, '__init__': <function SettableExtrapolationParameters.__init__>, '__repr__': <function SettableExtrapolationParameters.__repr__>, '__eq__': <function SettableExtrapolationParameters.__eq__>, '__match_args__': ('point_1', 'point_2', 'point_3')})
__doc__ = 'Extrapolation parameters that can be set by the user'
__eq__(other)

Return self==value.

__firstlineno__ = 14
__hash__ = None
__init__(point_1: float, point_2: float, point_3: float) None
__match_args__ = ('point_1', 'point_2', 'point_3')
__module__ = 'sas.sascalc.util'
__replace__(**changes)
__repr__()

Return repr(self).

__static_attributes__ = ()
__weakref__

list of weak references to the object

point_1: float
point_2: float
point_3: float
sas.sascalc.util.unique_preserve_order(seq: list[Any]) list[Any]

Remove duplicates from list preserving order Fastest according to benchmarks at https://www.peterbe.com/plog/uniqifiers-benchmark

Module contents