hyperiax.from_newick

hyperiax.from_newick(source, *, schema=None)[source]

Read a Newick tree (literal or file path) into a hyperiax Tree.

Branch lengths land on tree.data['edge_length'] (shape ()) with the current default floating dtype unless schema overrides it; the root edge length is whatever the Newick string reports (usually 0). Node names ride on Topology.names (static metadata), not in tree.data.

Parameters:
  • source (str | Path) – a Newick literal (string ending in ;) or a path to a Newick file.

  • schema (Schema | Mapping[str, tuple | FieldSpec | None] | None) – optional extra fields beyond edge_length; allocated as zeros for the caller to fill in afterwards.

Return type:

Tree

Returns:

A Tree whose schema always includes edge_length (()) plus any extras requested.