Skip to content

Commit

Permalink
Rename architecture interface to distinguish from network
Browse files Browse the repository at this point in the history
  • Loading branch information
frthjf committed Mar 25, 2024
1 parent 1069fe2 commit b51ef65
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _join(*args):
return uses


class NetworkArchitecture(Component):
class Architecture(Component):
"""Creates the network architecture by generating the soma coordinates within specified layer geometry."""

class Config(BaseModel):
Expand Down
18 changes: 10 additions & 8 deletions src/miv_simulator/interface/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class Config(BaseModel):
morphology_path: str = "./morphology"

def launch(self):
config = Config.from_yaml(self.config.config_filepath)
self.source_config = config = Config.from_yaml(
self.config.config_filepath
)

self.h5_types = get(
"miv_simulator.interface.h5_types",
Expand All @@ -27,8 +29,8 @@ def launch(self):
],
).launch()

self.network = get(
"miv_simulator.interface.network_architecture",
self.architecture = get(
"miv_simulator.interface.architecture",
[
{
"filepath": self.h5_types.output_filepath,
Expand All @@ -39,10 +41,10 @@ def launch(self):
uses=self.h5_types,
).launch()

self.distances = self.network.measure_distances().launch()
self.distances = self.architecture.measure_distances().launch()

self.synapse_forest = {
population: self.network.generate_synapse_forest(
population: self.architecture.generate_synapse_forest(
{
"population": population,
"morphology": os.path.join(
Expand All @@ -55,7 +57,7 @@ def launch(self):
}

self.synapses = {
population: self.network.distribute_synapses(
population: self.architecture.distribute_synapses(
{
"forest_filepath": self.synapse_forest[
population
Expand All @@ -74,7 +76,7 @@ def launch(self):
}

self.connections = {
population: self.network.generate_connections(
population: self.architecture.generate_connections(
{
"synapses": config.synapses,
"forest_filepath": self.synapses[
Expand All @@ -93,7 +95,7 @@ def launch(self):
self.neural_h5 = get(
"miv_simulator.interface.neuroh5_graph",
uses=[
self.network,
self.architecture,
self.distances,
*self.synapse_forest.values(),
*self.synapses.values(),
Expand Down
12 changes: 6 additions & 6 deletions src/miv_simulator/interface/neuroh5_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ def graph(self) -> None:

def __call__(self) -> None:
print("Merging H5 data")
self.network = None
self.architecture = None
self.distances = None
self.synapses = {}
self.synapse_forest = {}
self.connections = {}
populations = []
for u in self.uses:
name = u.module.replace("miv_simulator.interface.", "")
if name == "network_architecture":
self.network = u
if name == "architecture":
self.architecture = u
elif name == "distances":
self.distances = u
elif name == "connections":
Expand Down Expand Up @@ -60,9 +60,9 @@ def __call__(self) -> None:
)
self.synapses[u.config.population] = u

self.graph.import_h5types(self.network.config.filepath)
self.graph.import_h5types(self.architecture.config.filepath)
self.graph.import_soma_coordinates(
self.network.config.filepath,
self.architecture.config.filepath,
populations=list(populations) + ["STIM"],
)
for p in self.synapse_forest.keys():
Expand All @@ -80,7 +80,7 @@ def __call__(self) -> None:
self.save_file(
"graph.json",
{
"network": self.network.serialize(),
"architecture": self.architecture.serialize(),
"distances": self.distances.serialize(),
"connections": {
k: v.serialize() for k, v in self.connections.items()
Expand Down

0 comments on commit b51ef65

Please sign in to comment.