sampling.name

Community sample names.

Classes

Name

A community sample name has attributes

Module Contents

class sampling.name.Name(eco: str | None = None, sub: str | None = 'original', rep: int | None = None, size: int | None = None, com: list[str | pathlib.Path] | None = None, name: Self | None = None)[source]

A community sample name has attributes id, a symbolic ecosystem name or a hash of the community; sub, a subset, typically “original”, “minus”, or “added”; size, the number of models in the community; rep, a repetition number for multiple samples.

The class attribute serial of Name keeps a counter for each ecosystem, to generate unique serial numbers.

Parameters:
  • eco (str | None)

  • sub (str | None)

  • rep (int | None)

  • size (int | None)

  • com (list[str | pathlib.Path] | None)

  • name (Self | None)

static mk_id(community: list[str | pathlib.Path] | None) str[source]

Make an id for a community.

Parameters:

community (list[str | pathlib.Path] | None)

Return type:

str

classmethod from_string(string: str) Self[source]

Make ecosystem name from its string representation.

Parameters:

string (str)

Return type:

Self

__str__() str[source]

Serialize a community name.

Return type:

str

__eq__(other) bool[source]

Compare internal representations.

Return type:

bool

__hash__() int[source]

Default hash function.

Return type:

int