Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Sep 25, 2024
1 parent a114760 commit b36f6a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion emodel_generalisation/adaptation.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def __adapt_single_soma_ais(


def _adapt_single_soma_ais(*args, **kwargs):
timeout = kwargs.pop("timeout", 5 * 60)
timeout = kwargs.pop("timeout", 30 * 60)
res = isolate(__adapt_single_soma_ais, timeout=timeout)(*args, **kwargs)
if res is None:
print("timeout", args, kwargs)
Expand Down
2 changes: 1 addition & 1 deletion emodel_generalisation/bluecellulab_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def calculate_threshold_current(cell, config, holding_current):
def binsearch_threshold_current(cell, config, holding_current, min_current, max_current):
"""Binary search for threshold currents"""
mid_current = (min_current + max_current) / 2
if abs(max_current - min_current) < config["threshold_current_precision"]:
if abs(max_current - min_current) < config.get("threshold_current_precision", 0.001):
spike_count = run_spike_sim(
cell,
config,
Expand Down
9 changes: 6 additions & 3 deletions emodel_generalisation/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,15 @@ def compute_currents(
)

failed_cells = unique_cells_df[
unique_cells_df["input_resistance"].isna() | (unique_cells_df["input_resistance"] < 0)
unique_cells_df["input_resistance"].isna() | (unique_cells_df["input_resistance"] <= 0)
].index
if len(failed_cells) > 0:
L.info("still %s failed cells (we drop):", len(failed_cells))
L.info("still %s failed cells (we set default values):", len(failed_cells))
L.info(unique_cells_df.loc[failed_cells])
unique_cells_df.loc[failed_cells, "mtype"] = None
unique_cells_df.loc[failed_cells, "@dynamics:holding_current"] = 0.0
unique_cells_df.loc[failed_cells, "@dynamics:threshold_current"] = 0.0
unique_cells_df.loc[failed_cells, "@dynamics:input_resistance"] = 0.0
unique_cells_df.loc[failed_cells, "@dynamics:resting_potential"] = -80.0

cols = ["resting_potential", "input_resistance", "exception"]
if not only_rin:
Expand Down

0 comments on commit b36f6a1

Please sign in to comment.