alifestd_from_avida_spop_polars

alifestd_from_avida_spop_polars(spop_text: str, *, create_ancestor_list: bool = True, dtype_id: DataType | None = Int64) DataFrame

Convert Avida .spop population snapshot text to a phylogeny dataframe.

Parses the text content of an Avida .spop (structured population) file and returns a polars DataFrame in alife standard format.

Parameters

spop_textstr

Full text content of an Avida .spop file.

create_ancestor_listbool, default True

If True, include an ancestor_list column in the result.

dtype_idpl.DataType or None, default pl.Int64

Polars dtype for the id column. If None, the smallest signed integer dtype is chosen automatically based on the number of rows in the data.

Returns

pl.DataFrame

Phylogeny dataframe in alife standard format.

See Also

alifestd_from_avida_spop :

Pandas-based implementation.

Raises

ValueError

If the #format header is missing from the spop text.