pleiades.sammy.io.card_formats.inp02_element module

Card Set 2 (Element Information) for SAMMY INP files.

This module provides the Card02 class for parsing and generating the element information line in SAMMY input files. This card appears early in the INP file and defines the sample element, atomic weight, and energy range.

Format specification (Card Set 2):

Cols Format Variable Description 1-10 A ELMNT Sample element’s name (left-aligned) 11-20 F AW Atomic weight (amu) 21-30 F EMIN Minimum energy for dataset (eV) 31-40 F EMAX Maximum energy (eV)

Example

Si 27.976928 300000. 1800000.

class pleiades.sammy.io.card_formats.inp02_element.ElementInfo(*, element: Annotated[str, MaxLen(max_length=10)], atomic_weight: Annotated[float, Gt(gt=0)], min_energy: Annotated[float, Ge(ge=0)], max_energy: Annotated[float, Gt(gt=0)])[source]

Bases: BaseModel

Pydantic model for element information in Card Set 2.

element

Sample element’s name (up to 10 characters)

Type:

str

atomic_weight

Atomic weight in amu

Type:

float

min_energy

Minimum energy for dataset in eV

Type:

float

max_energy

Maximum energy in eV

Type:

float

element: str
atomic_weight: float
min_energy: float
max_energy: float
model_post_init(_ElementInfo__context) None[source]

Validate that max_energy > min_energy.

model_config = {}

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

class pleiades.sammy.io.card_formats.inp02_element.Card02[source]

Bases: BaseModel

Class representing Card Set 2 (element information) in SAMMY INP files.

This card defines the sample element, atomic weight, and energy range for the analysis.

classmethod from_lines(lines: List[str]) ElementInfo[source]

Parse element information from Card Set 2 line.

Parameters:

lines – List of input lines (expects single line for Card 2)

Returns:

Parsed element information

Return type:

ElementInfo

Raises:

ValueError – If format is invalid or required values missing

classmethod to_lines(element_info: ElementInfo) List[str][source]

Convert element information to Card Set 2 formatted line.

Parameters:

element_info – ElementInfo object containing element data

Returns:

List containing single formatted line for Card Set 2

model_config = {}

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