weac.components.segment module

This module defines the Segment class, which represents a segment of the snowpack.

class weac.components.segment.Segment(*, length=5000.0, has_foundation=True, is_loaded=True, m=0, f=<factory>)[source]

Bases: BaseModel

Defines a snow-slab segment: its length, foundation support, and applied loads.

Parameters:
  • length (Annotated[float, Ge(ge=0)])

  • has_foundation (bool)

  • is_loaded (bool)

  • m (Annotated[float, Ge(ge=0)])

  • f (Annotated[ndarray, PlainSerializer(func=~weac.components.segment._serialize_ndarray, return_type=list, when_used=always), WithJsonSchema(json_schema={'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}}, mode=None)])

length

Segment length in millimeters [mm].

Type:

float

has_foundation

Whether the segment is supported (foundation present) or cracked/free-hanging (no foundation).

Type:

bool

is_loaded

Whether additional loading is applied at the segment’s top side.

Type:

bool

m

Skier mass at the segment’s right edge [kg].

Type:

float

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

length: float
has_foundation: bool
is_loaded: bool
m: float
f: WithJsonSchema(json_schema={'type': 'array', 'items': {'type': 'array', 'items': {'type': 'number'}}}, mode=None)]
classmethod ensure_ndarray(v)[source]
Parameters:

v (ndarray[tuple[Any, ...], dtype[float64]])

Return type:

ndarray[tuple[Any, …], dtype[float64]]