Skip to content

Commit 08f5b10

Browse files
Removed problematic "ompl" dependency, added test morphological descriptors from revolve2, collision detector for ARIEL modules, missing docstrings (#92)
1 parent 29003b4 commit 08f5b10

6 files changed

Lines changed: 499 additions & 486 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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",

src/ariel/ec/genotypes/nde/nde.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

src/ariel/ec/genotypes/tree/io.py

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,49 @@
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)."""
32
from __future__ import annotations
43

5-
from typing import Dict, Any
4+
from typing import Any
5+
66
from .tree_genome import TreeGenome
77

88

99
def 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

1325
def 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

1736
def 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()

0 commit comments

Comments
 (0)