File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ dependencies = [
2828 " numpy>=2.0.2" ,
2929 " numpy-quaternion>=2023.0.3" ,
3030 " omegaconf>=2.3.0" ,
31- " ompl>=1.7.0" ,
3231 " opencv-python>=4.11.0.86" ,
3332 " panel>=1.8.9" ,
3433 " pillow>=11.3.0" ,
Original file line number Diff line number Diff line change @@ -121,19 +121,18 @@ def forward(
121121 self ,
122122 genotype : list [npt .NDArray [np .float32 ]],
123123 ) -> list [npt .NDArray [np .float32 ]]:
124- """
125- Forward pass through the neural developmental encoder.
124+ """Forward pass through the neural developmental encoder.
126125
127126 Parameters
128127 ----------
129128 genotype : list[npt.NDArray[np.float32]]
130129 List of chromosomes (numpy arrays).
130+
131131 Returns
132132 -------
133133 list[npt.NDArray[np.float32]]
134134 List of phenotype outputs (numpy arrays).
135135 """
136-
137136 outputs : list [npt .NDArray [np .float32 ]] = []
138137 for idx , chromosome in enumerate (genotype ):
139138 with torch .no_grad (): # double safety
Original file line number Diff line number Diff line change 1- """I/O helpers for tree genomes (JSON load/save and networkx conversion).
2- """
1+ """I/O helpers for tree genomes (JSON load/save and networkx conversion)."""
32from __future__ import annotations
43
5- from typing import Dict , Any
4+ from typing import Any
5+
66from .tree_genome import TreeGenome
77
88
99def load_genome (path : str ) -> TreeGenome :
10+ """Load a TreeGenome from a JSON file.
11+
12+ Parameters
13+ ----------
14+ path : str
15+ Path to the JSON file containing the genome.
16+
17+ Returns
18+ -------
19+ TreeGenome
20+ The loaded TreeGenome instance.
21+ """
1022 return TreeGenome .load_json (path )
1123
1224
1325def save_genome (genome : TreeGenome , path : str ) -> None :
26+ """Save a TreeGenome to a JSON file.
27+
28+ Parameters
29+ ----------
30+ genome : TreeGenome
31+ The TreeGenome instance to save.
1432 genome.save_json(path)
33+ """
1534
1635
1736def genome_to_networkx_dict (genome : TreeGenome ) -> dict [str , Any ]:
37+ """Convert a TreeGenome to a dictionary format compatible with networkx.
38+
39+ Parameters
40+ ----------
41+ genome : TreeGenome
42+ The TreeGenome instance to convert.
43+
44+ Returns
45+ -------
46+ dict[str, Any]
47+ A dictionary representation of the genome suitable for networkx.
48+ """
1849 return genome .to_dict ()
You can’t perform that action at this time.
0 commit comments