bmtool 0.5.7__tar.gz → 0.5.7.2__tar.gz

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.
Files changed (29) hide show
  1. {bmtool-0.5.7 → bmtool-0.5.7.2}/PKG-INFO +2 -1
  2. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/SLURM.py +18 -7
  3. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/bmplot.py +16 -7
  4. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool.egg-info/PKG-INFO +2 -1
  5. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool.egg-info/requires.txt +1 -0
  6. {bmtool-0.5.7 → bmtool-0.5.7.2}/setup.py +3 -2
  7. {bmtool-0.5.7 → bmtool-0.5.7.2}/LICENSE +0 -0
  8. {bmtool-0.5.7 → bmtool-0.5.7.2}/README.md +0 -0
  9. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/__init__.py +0 -0
  10. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/__main__.py +0 -0
  11. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/connectors.py +0 -0
  12. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/debug/__init__.py +0 -0
  13. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/debug/commands.py +0 -0
  14. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/debug/debug.py +0 -0
  15. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/graphs.py +0 -0
  16. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/manage.py +0 -0
  17. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/plot_commands.py +0 -0
  18. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/singlecell.py +0 -0
  19. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/synapses.py +0 -0
  20. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/util/__init__.py +0 -0
  21. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/util/commands.py +0 -0
  22. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/util/neuron/__init__.py +0 -0
  23. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/util/neuron/celltuner.py +0 -0
  24. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool/util/util.py +0 -0
  25. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool.egg-info/SOURCES.txt +0 -0
  26. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool.egg-info/dependency_links.txt +0 -0
  27. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool.egg-info/entry_points.txt +0 -0
  28. {bmtool-0.5.7 → bmtool-0.5.7.2}/bmtool.egg-info/top_level.txt +0 -0
  29. {bmtool-0.5.7 → bmtool-0.5.7.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bmtool
3
- Version: 0.5.7
3
+ Version: 0.5.7.2
4
4
  Summary: BMTool
5
5
  Home-page: https://github.com/cyneuro/bmtool
6
6
  Download-URL:
@@ -30,6 +30,7 @@ Requires-Dist: questionary
30
30
  Requires-Dist: pynmodlt
31
31
  Requires-Dist: xarray
32
32
  Requires-Dist: fooof
33
+ Requires-Dist: requests
33
34
 
34
35
  # bmtool
35
36
  A collection of modules to make developing [Neuron](https://www.neuron.yale.edu/neuron/) and [BMTK](https://alleninstitute.github.io/bmtk/) models easier.
@@ -59,7 +59,12 @@ def submit_job(script_path):
59
59
 
60
60
 
61
61
  def send_teams_message(webhook,message):
62
- # Message payload
62
+ """Sends a message to a teams channel or chat
63
+
64
+ Args:
65
+ webhook (str): A microsoft teams webhook
66
+ message (str): A message to send in the chat/channel
67
+ """
63
68
  message = {
64
69
  "text": f"{message}"
65
70
  }
@@ -256,8 +261,11 @@ export OUTPUT_DIR={case_output_dir}
256
261
  return True
257
262
 
258
263
  def check_block_completed(self):
259
- # Implement this method to check if all jobs are completed
260
- # This should return True only if all jobs are in the COMPLETED state
264
+ """checks if all the jobs in the block have been completed by slurm
265
+
266
+ Returns:
267
+ bool: True if all block jobs have been ran, false if job is still running
268
+ """
261
269
  for job_id in self.job_ids:
262
270
  status = check_job_status(job_id)
263
271
  if status != 'COMPLETED': # can add PENDING here for debugging NOT FOR ACTUALLY USING IT
@@ -266,8 +274,11 @@ export OUTPUT_DIR={case_output_dir}
266
274
 
267
275
 
268
276
  def check_block_running(self):
269
- # Implement this method to check if all jobs are completed
270
- # This should return True only if all jobs are in the COMPLETED state
277
+ """checks if a job is running
278
+
279
+ Returns:
280
+ bool: True if jobs are RUNNING false if anything else
281
+ """
271
282
  for job_id in self.job_ids:
272
283
  status = check_job_status(job_id)
273
284
  if status != 'RUNNING': #
@@ -283,6 +294,7 @@ class SequentialBlockRunner:
283
294
  blocks (list): List of SimulationBlock instances to be run.
284
295
  json_editor (seedSweep or multiSweep): Instance of seedSweep to edit JSON file.
285
296
  param_values (list): List of values for the parameter to be modified.
297
+ webhook (str): a microsoft webhook for teams. When used will send teams messages to the hook!
286
298
  """
287
299
 
288
300
  def __init__(self, blocks, json_editor=None, param_values=None, check_interval=200,webhook=None):
@@ -322,9 +334,8 @@ class SequentialBlockRunner:
322
334
  message = f"SIMULATION UPDATE: Block {i} has been submitted! There are {(len(self.blocks)-1)-i} left to be submitted"
323
335
  send_teams_message(self.webhook,message)
324
336
 
325
- time.sleep(self.check_interval)
326
337
  # Wait for the block to complete
327
- if i == len(self.blocks): # we want to wait for the last block to be completed not just running
338
+ if i == len(self.blocks) - 1: # Corrected index to check the last block
328
339
  while not block.check_block_completed():
329
340
  print(f"Waiting for the last block {i} to complete...")
330
341
  time.sleep(self.check_interval)
@@ -197,7 +197,7 @@ def probability_connection_matrix(config=None,nodes=None,edges=None,title=None,s
197
197
 
198
198
  return
199
199
 
200
- def convergence_connection_matrix(config=None,title=None,sources=None, targets=None, sids=None, tids=None, no_prepend_pop=False,save_file=None,convergence=True,method='mean+std',include_gap=True):
200
+ def convergence_connection_matrix(config=None,title=None,sources=None, targets=None, sids=None, tids=None, no_prepend_pop=False,save_file=None,convergence=True,method='mean+std',include_gap=True,return_dict=None):
201
201
  """
202
202
  Generates connection plot displaying convergence data
203
203
  config: A BMTK simulation config
@@ -213,9 +213,9 @@ def convergence_connection_matrix(config=None,title=None,sources=None, targets=N
213
213
  raise Exception("config not defined")
214
214
  if not sources or not targets:
215
215
  raise Exception("Sources or targets not defined")
216
- return divergence_connection_matrix(config,title ,sources, targets, sids, tids, no_prepend_pop, save_file ,convergence, method,include_gap=include_gap)
216
+ return divergence_connection_matrix(config,title ,sources, targets, sids, tids, no_prepend_pop, save_file ,convergence, method,include_gap=include_gap,return_dict=return_dict)
217
217
 
218
- def divergence_connection_matrix(config=None,title=None,sources=None, targets=None, sids=None, tids=None, no_prepend_pop=False,save_file=None,convergence=False,method='mean+std',include_gap=True):
218
+ def divergence_connection_matrix(config=None,title=None,sources=None, targets=None, sids=None, tids=None, no_prepend_pop=False,save_file=None,convergence=False,method='mean+std',include_gap=True,return_dict=None):
219
219
  """
220
220
  Generates connection plot displaying divergence data
221
221
  config: A BMTK simulation config
@@ -264,8 +264,12 @@ def divergence_connection_matrix(config=None,title=None,sources=None, targets=No
264
264
  title = title + "Synaptic Convergence"
265
265
  else:
266
266
  title = title + "Synaptic Divergence"
267
- plot_connection_info(syn_info,data,source_labels,target_labels,title, save_file=save_file)
268
- return
267
+ if return_dict:
268
+ dict = plot_connection_info(syn_info,data,source_labels,target_labels,title, save_file=save_file,return_dict=return_dict)
269
+ return dict
270
+ else:
271
+ plot_connection_info(syn_info,data,source_labels,target_labels,title, save_file=save_file)
272
+ return
269
273
 
270
274
  def gap_junction_matrix(config=None,title=None,sources=None, targets=None, sids=None,tids=None, no_prepend_pop=False,save_file=None,type='convergence'):
271
275
  """
@@ -448,7 +452,7 @@ def edge_histogram_matrix(config=None,sources = None,targets=None,sids=None,tids
448
452
  fig.text(0.04, 0.5, 'Source', va='center', rotation='vertical')
449
453
  plt.draw()
450
454
 
451
- def plot_connection_info(text, num, source_labels,target_labels, title, syn_info='0', save_file=None):
455
+ def plot_connection_info(text, num, source_labels,target_labels, title, syn_info='0', save_file=None,return_dict=None):
452
456
  """
453
457
  write about function here
454
458
  """
@@ -472,10 +476,12 @@ def plot_connection_info(text, num, source_labels,target_labels, title, syn_info
472
476
  plt.setp(ax1.get_xticklabels(), rotation=45, ha="right",
473
477
  rotation_mode="anchor", size=12, weight = 'semibold')
474
478
 
479
+ graph_dict = {}
475
480
  # Loop over data dimensions and create text annotations.
476
481
  for i in range(num_source):
477
482
  for j in range(num_target):
478
483
  edge_info = text[i,j]
484
+ graph_dict[str(source_labels[i])+'2'+str(target_labels[j])] = edge_info
479
485
  if syn_info =='2' or syn_info =='3':
480
486
  if num_source > 8 and num_source <20:
481
487
  fig_text = ax1.text(j, i, edge_info,
@@ -499,7 +505,10 @@ def plot_connection_info(text, num, source_labels,target_labels, title, syn_info
499
505
  fig1.show()
500
506
  if save_file:
501
507
  plt.savefig(save_file)
502
- return
508
+ if return_dict:
509
+ return graph_dict
510
+ else:
511
+ return
503
512
 
504
513
  def connector_percent_matrix(csv_path: str = None, exclude_shell: bool = True,
505
514
  exclude_assembly: bool = False, title: str = 'Percent connection matrix') -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bmtool
3
- Version: 0.5.7
3
+ Version: 0.5.7.2
4
4
  Summary: BMTool
5
5
  Home-page: https://github.com/cyneuro/bmtool
6
6
  Download-URL:
@@ -30,6 +30,7 @@ Requires-Dist: questionary
30
30
  Requires-Dist: pynmodlt
31
31
  Requires-Dist: xarray
32
32
  Requires-Dist: fooof
33
+ Requires-Dist: requests
33
34
 
34
35
  # bmtool
35
36
  A collection of modules to make developing [Neuron](https://www.neuron.yale.edu/neuron/) and [BMTK](https://alleninstitute.github.io/bmtk/) models easier.
@@ -10,3 +10,4 @@ questionary
10
10
  pynmodlt
11
11
  xarray
12
12
  fooof
13
+ requests
@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
6
6
 
7
7
  setup(
8
8
  name="bmtool",
9
- version='0.5.7',
9
+ version='0.5.7.2',
10
10
  author="Neural Engineering Laboratory at the University of Missouri",
11
11
  author_email="gregglickert@mail.missouri.edu",
12
12
  description="BMTool",
@@ -27,7 +27,8 @@ setup(
27
27
  'questionary',
28
28
  'pynmodlt',
29
29
  'xarray',
30
- 'fooof'
30
+ 'fooof',
31
+ 'requests'
31
32
  ],
32
33
  classifiers=[
33
34
  'Intended Audience :: Developers',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes