Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused 'test' entries in the example pyr.json #51

Merged
merged 5 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bluepyemodel/emodel_pipeline/emodel_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,13 @@ def plot(self, only_validated=False, load_from_local=False):
record_ions_and_currents=self.access_point.pipeline_settings.plot_currentscape,
)

chkp_paths = glob.glob("./checkpoints/**/*.pkl", recursive=True)
if not chkp_paths:
raise ValueError("The checkpoints directory is empty, or there are no .pkl files.")

# Filter the checkpoints to plot
checkpoint_paths = []
for chkp_path in glob.glob("./checkpoints/**/*.pkl", recursive=True):
for chkp_path in chkp_paths:
if self.access_point.emodel_metadata.emodel not in chkp_path:
continue
if (
Expand Down
4 changes: 3 additions & 1 deletion bluepyemodel/emodel_pipeline/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def evolution_parameters_density(

def scores(model, figures_dir="./figures", write_fig=True):
"""Plot the scores of a model"""
SCORE_THRESHOLD = 5.0

make_dir(figures_dir)

score = list(model.scores.values()) + list(model.scores_validation.values())
Expand All @@ -345,7 +347,7 @@ def scores(model, figures_dir="./figures", write_fig=True):
axs[0, 0].barh(pos, score, height=0.7, align="center", color="gray")

for p, s in zip(pos, score):
if s > 5.0:
if s > SCORE_THRESHOLD:
axs[0, 0].text(5.15, p - 0.25, s="{:.1f}".format(s), color="red", fontsize=8)

axs[0, 0].set_xlabel("z-score")
Expand Down
1 change: 1 addition & 0 deletions examples/emodel_pipeline_local_python/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Finally, the different steps of the pipeline can be run with the commands:
pipeline.extract_efeatures()
pipeline.optimise(seed=1)
pipeline.store_optimisation_results()
pipeline.validation()
pipeline.plot(only_validated=False)

This snippet will likely not be used as such as the different steps of the pipeline are computationally intensive and will be run separately.
Expand Down
62 changes: 31 additions & 31 deletions examples/emodel_pipeline_local_python/config/params/pyr.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
{"name":"celsius", "val":34}
],
"distribution_decay": [
{"name":"constant", "val":[-0.1, 0.0], "test": -0.0054993896903911335}
{"name":"constant", "val":[-0.1, 0.0]}
],
"myelinated": [
{"name":"cm", "val":0.02}
],
"all": [
{"name":"Ra", "val":100},
{"name":"g_pas", "val":[1e-5, 6e-5], "test":5.3926647384073322e-05},
{"name":"e_pas", "val":[-95, -60], "test":-75.862421167964129}
{"name":"g_pas", "val":[1e-5, 6e-5]},
{"name":"e_pas", "val":[-95, -60]}
],
"somadend": [
{"name":"gIhbar_Ih", "val":[0, 2e-4], "test":4.9710877962221885e-06, "dist":"exp",
{"name":"gIhbar_Ih", "val":[0, 2e-4], "dist":"exp",
"__comment": "distribution starts in soma (uniform) and spreads exponentially to dendrites"}
],
"axonal": [
Expand All @@ -49,16 +49,16 @@
{"name":"ek", "val":-90},
{"name":"vshifth_NaTg", "val":10},
{"name":"slopem_NaTg", "val":9},
{"name":"gNaTgbar_NaTg", "val":[0, 1.5], "test":0.45001599746214271},
{"name":"gNap_Et2bar_Nap_Et2", "val":[0, 0.02], "test":0.0074930910112714971},
{"name":"gK_Pstbar_K_Pst", "val":[0, 1], "test":0.41317541509924871},
{"name":"gK_Tstbar_K_Tst", "val":[0, 0.2], "test":0.18323702633195063},
{"name":"gSKv3_1bar_SKv3_1", "val":[0, 1], "test":0.59766537780998541},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.001], "test":0.00065484400421279019},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.01], "test":0.0006624110987988748},
{"name":"gSK_E2bar_SK_E2", "val":[0, 0.1], "test":0.0055436826094973947},
{"name":"decay_CaDynamics_DC0", "val":[20, 300], "test": 187.93939189992398},
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05], "test":0.018262044595632514}
{"name":"gNaTgbar_NaTg", "val":[0, 1.5]},
{"name":"gNap_Et2bar_Nap_Et2", "val":[0, 0.02]},
{"name":"gK_Pstbar_K_Pst", "val":[0, 1]},
{"name":"gK_Tstbar_K_Tst", "val":[0, 0.2]},
{"name":"gSKv3_1bar_SKv3_1", "val":[0, 1]},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.001]},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.01]},
{"name":"gSK_E2bar_SK_E2", "val":[0, 0.1]},
{"name":"decay_CaDynamics_DC0", "val":[20, 300]},
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05]}
],
"somatic": [
{"name":"cm", "val":1},
Expand All @@ -67,33 +67,33 @@
{"name":"vshiftm_NaTg", "val":13},
{"name":"vshifth_NaTg", "val":15},
{"name":"slopem_NaTg", "val":7},
{"name":"gNaTgbar_NaTg", "val":[0, 0.3], "test":0.22533600162118178},
{"name":"gK_Pstbar_K_Pst", "val":[0, 0.2], "test":0.15029253289238459},
{"name":"gK_Tstbar_K_Tst", "val":[0, 0.1], "test":0.0048028568033722466},
{"name":"gSKv3_1bar_SKv3_1", "val":[0, 1], "test":0.17097147644202285},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.001], "test":0.00056391253652122346},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.01], "test":0.0010207881257459726},
{"name":"gSK_E2bar_SK_E2", "val":[0, 0.1], "test":0.079708174678391613},
{"name":"decay_CaDynamics_DC0", "val":[20, 300], "test":104.85544592336207},
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05], "test":0.02349598838420491}
{"name":"gNaTgbar_NaTg", "val":[0, 0.3]},
{"name":"gK_Pstbar_K_Pst", "val":[0, 0.2]},
{"name":"gK_Tstbar_K_Tst", "val":[0, 0.1]},
{"name":"gSKv3_1bar_SKv3_1", "val":[0, 1]},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.001]},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.01]},
{"name":"gSK_E2bar_SK_E2", "val":[0, 0.1]},
{"name":"decay_CaDynamics_DC0", "val":[20, 300]},
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05]}
],
"apical": [
{"name":"cm", "val":2},
{"name":"ena", "val":50},
{"name":"ek", "val":-90},
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05], "test":0.0066739787731804143},
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05]},
{"name":"vshiftm_NaTg", "val":6},
{"name":"vshifth_NaTg", "val":6},
{"name":"gNaTgbar_NaTg", "val":[0, 0.1], "test": 0.099937269709686416, "dist":"decay"},
{"name":"gSKv3_1bar_SKv3_1", "val":[0, 0.003], "test":0.0014911639485230455},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.0001], "test":2.0449633205094153e-05},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.001], "test":0.00011242611925684145}
{"name":"gNaTgbar_NaTg", "val":[0, 0.1], "dist":"decay"},
{"name":"gSKv3_1bar_SKv3_1", "val":[0, 0.003]},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.0001]},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.001]}
],
"basal": [
{"name":"cm", "val":2},
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05], "test":0.04066564973313349},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.0001], "test":8.087166736008117e-05},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.001], "test":2.7582661164552104e-05}
{"name":"gamma_CaDynamics_DC0", "val":[0.005, 0.05]},
{"name":"gCa_HVAbar_Ca_HVA2", "val":[0, 0.0001]},
{"name":"gCa_LVAstbar_Ca_LVAst", "val":[0, 0.001]}
]
}
}