bmtool 0.5.7__py3-none-any.whl → 0.5.7.1__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.
- bmtool/SLURM.py +18 -7
- {bmtool-0.5.7.dist-info → bmtool-0.5.7.1.dist-info}/METADATA +1 -1
- {bmtool-0.5.7.dist-info → bmtool-0.5.7.1.dist-info}/RECORD +7 -7
- {bmtool-0.5.7.dist-info → bmtool-0.5.7.1.dist-info}/LICENSE +0 -0
- {bmtool-0.5.7.dist-info → bmtool-0.5.7.1.dist-info}/WHEEL +0 -0
- {bmtool-0.5.7.dist-info → bmtool-0.5.7.1.dist-info}/entry_points.txt +0 -0
- {bmtool-0.5.7.dist-info → bmtool-0.5.7.1.dist-info}/top_level.txt +0 -0
bmtool/SLURM.py
CHANGED
@@ -59,7 +59,12 @@ def submit_job(script_path):
|
|
59
59
|
|
60
60
|
|
61
61
|
def send_teams_message(webhook,message):
|
62
|
-
|
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
|
-
|
260
|
-
|
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
|
-
|
270
|
-
|
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):
|
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)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
bmtool/SLURM.py,sha256=
|
1
|
+
bmtool/SLURM.py,sha256=AX5MKV7dD-XwS8SROnW1IyesZ3jDwMf0txO6mHxTbuw,13694
|
2
2
|
bmtool/__init__.py,sha256=ZStTNkAJHJxG7Pwiy5UgCzC4KlhMS5pUNPtUJZVwL_Y,136
|
3
3
|
bmtool/__main__.py,sha256=TmFkmDxjZ6250nYD4cgGhn-tbJeEm0u-EMz2ajAN9vE,650
|
4
4
|
bmtool/bmplot.py,sha256=-kw4VOcTnA22JVQi1PzH2E308pcmY1Xo7oqgCnm0cC8,46260
|
@@ -16,9 +16,9 @@ bmtool/util/commands.py,sha256=zJF-fiLk0b8LyzHDfvewUyS7iumOxVnj33IkJDzux4M,64396
|
|
16
16
|
bmtool/util/util.py,sha256=24E5rUoDU86nqypDF4uZJkuJKO1BrwrQE8lZzAxu1kw,56770
|
17
17
|
bmtool/util/neuron/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
bmtool/util/neuron/celltuner.py,sha256=xSRpRN6DhPFz4q5buq_W8UmsD7BbUrkzYBEbKVloYss,87194
|
19
|
-
bmtool-0.5.7.dist-info/LICENSE,sha256=qrXg2jj6kz5d0EnN11hllcQt2fcWVNumx0xNbV05nyM,1068
|
20
|
-
bmtool-0.5.7.dist-info/METADATA,sha256=
|
21
|
-
bmtool-0.5.7.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
22
|
-
bmtool-0.5.7.dist-info/entry_points.txt,sha256=0-BHZ6nUnh0twWw9SXNTiRmKjDnb1VO2DfG_-oprhAc,45
|
23
|
-
bmtool-0.5.7.dist-info/top_level.txt,sha256=gpd2Sj-L9tWbuJEd5E8C8S8XkNm5yUE76klUYcM-eWM,7
|
24
|
-
bmtool-0.5.7.dist-info/RECORD,,
|
19
|
+
bmtool-0.5.7.1.dist-info/LICENSE,sha256=qrXg2jj6kz5d0EnN11hllcQt2fcWVNumx0xNbV05nyM,1068
|
20
|
+
bmtool-0.5.7.1.dist-info/METADATA,sha256=cgwZVmUCp3LN20uI_TD0FkTlxfvlNDei3HlW1-PVHi4,24107
|
21
|
+
bmtool-0.5.7.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
22
|
+
bmtool-0.5.7.1.dist-info/entry_points.txt,sha256=0-BHZ6nUnh0twWw9SXNTiRmKjDnb1VO2DfG_-oprhAc,45
|
23
|
+
bmtool-0.5.7.1.dist-info/top_level.txt,sha256=gpd2Sj-L9tWbuJEd5E8C8S8XkNm5yUE76klUYcM-eWM,7
|
24
|
+
bmtool-0.5.7.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|