Skip to content

Commit

Permalink
improvements to config_syn error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
iraikov committed Sep 2, 2024
1 parent 6cf2487 commit 531ce2e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/miv_simulator/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ def __init__(
self.microcircuit_input_sources = {
pop_name: set() for pop_name in self.celltypes.keys()
}
if rank == 0:
self.logger.info(
f"env.microcircuit_inputs = {self.microcircuit_inputs}\n"
f"env.microcircuit_input_sources = {self.microcircuit_input_sources}"
)

# Configuration profile for optogenetic stimulation
self.opsin_config = None
Expand Down
2 changes: 2 additions & 0 deletions src/miv_simulator/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,8 @@ def init(env: Env, subworld_size: Optional[int] = None) -> None:
if env.profile_memory and rank == 0:
profile_memory(logger)

env.pc.barrier()

st = time.time()
init_input_cells(env)
env.mkstimtime = time.time() - st
Expand Down
11 changes: 8 additions & 3 deletions src/miv_simulator/synapses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,9 @@ def config_syn(
nc_param = False
mech_param = False


for param, val in params.items():

failed = True
if param in mech_rules["mech_params"]:
if syn is None:
Expand Down Expand Up @@ -2206,12 +2208,14 @@ def config_syn(
else:
if val is None:
raise AttributeError(
f"config_syn: netcon attribute {param} is None for synaptic mechanism: {mech_name}"
f"config_syn: netcon attribute {param} is None for synapse {syn_name} "
f"synaptic mechanism: {mech_name}; params are {params}"
)
if isinstance(val, list):
if len(val) > 1:
raise AttributeError(
"config_syn: netcon attribute {param} is list of length > 1 for synaptic mechanism: {mech_name}"
f"config_syn: netcon attribute {param} is list of length > 1 for synapse {syn_name} "
f"synaptic mechanism: {mech_name}"
)
new = val[0]
else:
Expand All @@ -2221,7 +2225,8 @@ def config_syn(
failed = False
if failed:
raise AttributeError(
f"config_syn: problem setting attribute: {param} for synaptic mechanism: {mech_name}"
f"config_syn: problem setting attribute: {param} for synapse {syn_name} "
f"synaptic mechanism: {mech_name}"
)
return (mech_param, nc_param)

Expand Down

0 comments on commit 531ce2e

Please sign in to comment.