bluecellulab 2.6.57__py3-none-any.whl → 2.6.58__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bluecellulab might be problematic. Click here for more details.

@@ -350,7 +350,6 @@ class BPAP:
350
350
  validated = True
351
351
  notes = ""
352
352
  popt_dend, popt_apic = self.fit(soma_amp, dend_amps, dend_dist, apic_amps, apic_dist)
353
- logging.warning(popt_dend)
354
353
  if dend_amps is not None:
355
354
  plt.cla()
356
355
  plt.plot([0], soma_amp, '.')
@@ -25,6 +25,7 @@ from bluecellulab.analysis.analysis import compute_plot_iv_curve
25
25
  from bluecellulab.analysis.inject_sequence import run_multirecordings_stimulus
26
26
  from bluecellulab.analysis.inject_sequence import run_stimulus
27
27
  from bluecellulab.cell.core import Cell
28
+ from bluecellulab.simulation.neuron_globals import NeuronGlobals
28
29
  from bluecellulab.stimulus.factory import IDRestTimings
29
30
  from bluecellulab.stimulus.factory import StimulusFactory
30
31
  from bluecellulab.tools import calculate_input_resistance
@@ -33,15 +34,17 @@ from bluecellulab.tools import calculate_rheobase
33
34
  logger = logging.getLogger(__name__)
34
35
 
35
36
 
36
- def plot_trace(recording, out_dir, fname, title):
37
+ def plot_trace(recording, out_dir, fname, title, plot_current=True):
37
38
  """Plot a trace with inout current given a recording."""
38
39
  outpath = out_dir / fname
39
40
  fig, ax1 = plt.subplots(figsize=(10, 6))
40
41
  plt.plot(recording.time, recording.voltage, color="black")
41
- current_axis = ax1.twinx()
42
- current_axis.plot(recording.time, recording.current, color="gray", alpha=0.6)
43
- current_axis.set_ylabel("Stimulus Current [nA]")
44
- fig.suptitle(title)
42
+ if plot_current:
43
+ current_axis = ax1.twinx()
44
+ current_axis.plot(recording.time, recording.current, color="gray", alpha=0.6)
45
+ current_axis.set_ylabel("Stimulus Current [nA]")
46
+ if title:
47
+ fig.suptitle(title)
45
48
  ax1.set_xlabel("Time [ms]")
46
49
  ax1.set_ylabel("Voltage [mV]")
47
50
  fig.tight_layout()
@@ -410,8 +413,42 @@ def fi_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
410
413
  }
411
414
 
412
415
 
416
+ def thumbnail_test(template_params, rheobase, out_dir):
417
+ """Thumbnail test: creating a thumbnail."""
418
+ stim_factory = StimulusFactory(dt=1.0)
419
+ step_stimulus = stim_factory.idrest(threshold_current=rheobase, threshold_percentage=130)
420
+ recording = run_stimulus(
421
+ template_params,
422
+ step_stimulus,
423
+ "soma[0]",
424
+ 0.5,
425
+ add_hypamp=True,
426
+ )
427
+
428
+ # plotting
429
+ outpath = plot_trace(
430
+ recording,
431
+ out_dir,
432
+ fname="thumbnail.pdf",
433
+ title="",
434
+ plot_current=False
435
+ )
436
+
437
+ return {
438
+ "name": "thumbnail",
439
+ "passed": True,
440
+ "validation_details": "",
441
+ "figures": [outpath],
442
+ }
443
+
444
+
413
445
  def run_validations(
414
- cell, cell_name, spike_threshold_voltage=-30, output_dir="./memodel_validation_figures"
446
+ cell,
447
+ cell_name,
448
+ spike_threshold_voltage=-30,
449
+ v_init=-80.0,
450
+ celsius=34.0,
451
+ output_dir="./memodel_validation_figures"
415
452
  ):
416
453
  """Run all the validations on the cell.
417
454
 
@@ -419,11 +456,18 @@ def run_validations(
419
456
  cell (Cell): The cell to validate.
420
457
  cell_name (str): The name of the cell, used in the output directory.
421
458
  spike_threshold_voltage (float): The voltage threshold for spike detection.
459
+ v_init: Initial membrane potential. Default is -80.0 mV.
460
+ celsius: Temperature in Celsius. Default is 34.0.
422
461
  output_dir (str): The directory to save the validation figures.
423
462
  """
424
463
  out_dir = pathlib.Path(output_dir) / cell_name
425
464
  out_dir.mkdir(parents=True, exist_ok=True)
426
465
 
466
+ # set initial voltage and temperature
467
+ neuron_globals = NeuronGlobals.get_instance()
468
+ neuron_globals.temperature = celsius
469
+ neuron_globals.v_init = v_init
470
+
427
471
  # get me-model properties
428
472
  holding_current = cell.hypamp if cell.hypamp else 0.0
429
473
  if cell.threshold:
@@ -473,6 +517,9 @@ def run_validations(
473
517
  # Validation 9: FI Test
474
518
  fi_test_result = fi_test(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
475
519
 
520
+ # Validation 10: Thumbnail Test
521
+ thumbnail_result = thumbnail_test(cell.template_params, rheobase, out_dir)
522
+
476
523
  return {
477
524
  "memodel_properties": {
478
525
  "holding_current": holding_current,
@@ -487,4 +534,5 @@ def run_validations(
487
534
  "rin_test": rin_result,
488
535
  "iv_test": iv_test_result,
489
536
  "fi_test": fi_test_result,
537
+ "thumbnail_test": thumbnail_result,
490
538
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bluecellulab
3
- Version: 2.6.57
3
+ Version: 2.6.58
4
4
  Summary: Biologically detailed neural network simulations and analysis.
5
5
  Author: Blue Brain Project, EPFL
6
6
  License: Apache2.0
@@ -15,7 +15,7 @@ bluecellulab/type_aliases.py,sha256=DvgjERv2Ztdw_sW63JrZTQGpJ0x5uMTFB5hcBHDb0WA,
15
15
  bluecellulab/utils.py,sha256=0NhwlzyLnSi8kziSfDsQf7pokO4qDkMJVAO33kSX4O0,2227
16
16
  bluecellulab/verbosity.py,sha256=T0IgX7DrRo19faxrT4Xzb27gqxzoILQ8FzYKxvUeaPM,1342
17
17
  bluecellulab/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- bluecellulab/analysis/analysis.py,sha256=rZdM7AjjCLFoW7x0d_R6oQPLAasz_R6UxSVgcKTUJW0,21646
18
+ bluecellulab/analysis/analysis.py,sha256=O2nKHdVqVuL8SP_Q-FjyaRyHJdJCf0315bNrCTVies4,21611
19
19
  bluecellulab/analysis/inject_sequence.py,sha256=bpi_C1oz_G5cZv_CvvZG8SnGYaKIlDsIFHdkOAkDm-E,12666
20
20
  bluecellulab/analysis/plotting.py,sha256=PqRoaZz33ULMw8A9YnZXXrxcUd84M_dwlYMTFhG7YT4,3999
21
21
  bluecellulab/analysis/utils.py,sha256=eMirP557D11BuedgSqjripDxOq1haIldNbnYNetV1bg,121
@@ -67,10 +67,10 @@ bluecellulab/stimulus/stimulus.py,sha256=a_hKJUtZmIgjiFjbJf6RzUPokELqn0IHCgIWGw5
67
67
  bluecellulab/synapse/__init__.py,sha256=RW8XoAMXOvK7OG1nHl_q8jSEKLj9ZN4oWf2nY9HAwuk,192
68
68
  bluecellulab/synapse/synapse_factory.py,sha256=NHwRMYMrnRVm_sHmyKTJ1bdoNmWZNU4UPOGu7FCi-PE,6987
69
69
  bluecellulab/synapse/synapse_types.py,sha256=zs_yBvGTH4QrbQF3nEViidyq1WM_ZcTSFdjUxB3khW0,16871
70
- bluecellulab/validation/validation.py,sha256=00g16X9ngQeVxKpec4SpXb8oTJ3qzfTfifEP5D8AWVE,17149
71
- bluecellulab-2.6.57.dist-info/licenses/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
72
- bluecellulab-2.6.57.dist-info/licenses/LICENSE,sha256=dAMAR2Sud4Nead1wGFleKiwTZfkTNZbzmuGfcTKb3kg,11335
73
- bluecellulab-2.6.57.dist-info/METADATA,sha256=xzTnRYLR2MSR8x0mNnKVnhqOol-zmA2hNJcHkxBvovg,8259
74
- bluecellulab-2.6.57.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
- bluecellulab-2.6.57.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
76
- bluecellulab-2.6.57.dist-info/RECORD,,
70
+ bluecellulab/validation/validation.py,sha256=X8Pwj2oCPiMjBdMMWj2SwRSbnyZcUjqFo3PGT-6lWho,18465
71
+ bluecellulab-2.6.58.dist-info/licenses/AUTHORS.txt,sha256=EDs3H-2HXBojbma10psixk3C2rFiOCTIREi2ZAbXYNQ,179
72
+ bluecellulab-2.6.58.dist-info/licenses/LICENSE,sha256=dAMAR2Sud4Nead1wGFleKiwTZfkTNZbzmuGfcTKb3kg,11335
73
+ bluecellulab-2.6.58.dist-info/METADATA,sha256=OzN36WwPMe2uppSyBP5xvseDBhpFjou8kce_gnut0mc,8259
74
+ bluecellulab-2.6.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
+ bluecellulab-2.6.58.dist-info/top_level.txt,sha256=VSyEP8w9l3pXdRkyP_goeMwiNA8KWwitfAqUkveJkdQ,13
76
+ bluecellulab-2.6.58.dist-info/RECORD,,