Skip to content

Commit 0de4184

Browse files
committed
Top-level notebook to analyze aggregated instance data. Incomplete since can't run due to Perlmutter down for maintenance.
1 parent e76ad6c commit 0de4184

2 files changed

Lines changed: 94 additions & 10 deletions

File tree

examples-proposed/024-aggregated-compute-ensemble/driver.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
from ipsframework import Component
1010
from ipsframework.ipsutil import params_from_csv
1111

12+
# The notebook that will be copied for each ensemble instance
13+
SOURCE_NOTEBOOK_NAME='global_notebook.ipynb'
14+
1215

1316
class EnsembleDriver(Component):
1417
"""Kicks off a simple ensemble"""
1518

1619
def init(self, timestamp=0.0):
17-
pass
18-
# TODO temporarily commenting this out until the actual
19-
# example is ready to consider adding a notebook to the portal.
20-
21-
# NOTEBOOK_TEMPLATE = 'notebook.ipynb'
22-
# self.services.stage_input_files([NOTEBOOK_TEMPLATE])
23-
# try:
24-
# self.services.initialize_jupyter_notebook(NOTEBOOK_TEMPLATE)
25-
# except Exception:
26-
# print('did not add notebook to portal')
20+
self.services.stage_input_files([SOURCE_NOTEBOOK_NAME])
21+
22+
self.services.initialize_jupyter_notebook(
23+
dest_notebook_name='jupyterhub_global_notebook.ipynb',
24+
source_notebook_path=SOURCE_NOTEBOOK_NAME,
25+
)
26+
2727

2828
def step(self, timestamp=0.0):
2929
# This CSV file contains the parameters used for the
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "initial_id",
7+
"metadata": {
8+
"collapsed": true
9+
},
10+
"outputs": [],
11+
"source": [
12+
"# This is the top-level notebook for analysing all the data from\n",
13+
"# the ensemble instances."
14+
]
15+
},
16+
{
17+
"metadata": {
18+
"ExecuteTime": {
19+
"end_time": "2026-01-21T15:24:56.068204Z",
20+
"start_time": "2026-01-21T15:24:56.059637Z"
21+
}
22+
},
23+
"cell_type": "code",
24+
"source": [
25+
"import json\n",
26+
"import csv\n",
27+
"from pathlib import Path\n",
28+
"\n",
29+
"%matplotlib notebook\n",
30+
"import matplotlib.pyplot as plt"
31+
],
32+
"id": "857879d9069625cf",
33+
"outputs": [],
34+
"execution_count": 2
35+
},
36+
{
37+
"metadata": {
38+
"ExecuteTime": {
39+
"end_time": "2026-01-21T15:24:48.049301Z",
40+
"start_time": "2026-01-21T15:24:48.038184Z"
41+
}
42+
},
43+
"cell_type": "code",
44+
"source": [
45+
"a = ips_analysis_api.get_data()\n",
46+
"b = ips_analysis_api.get_child_data()\n",
47+
"c = ips_analysis_api.get_child_data_not_ensembles()\n",
48+
"d = ips_analysis_api.get_child_data_by_ensemble_names()"
49+
],
50+
"id": "3d8fa1127a2ab4ef",
51+
"outputs": [],
52+
"execution_count": 1
53+
},
54+
{
55+
"metadata": {},
56+
"cell_type": "code",
57+
"outputs": [],
58+
"execution_count": null,
59+
"source": "",
60+
"id": "c2e3d3e1518509f8"
61+
}
62+
],
63+
"metadata": {
64+
"kernelspec": {
65+
"display_name": "Python 3",
66+
"language": "python",
67+
"name": "python3"
68+
},
69+
"language_info": {
70+
"codemirror_mode": {
71+
"name": "ipython",
72+
"version": 2
73+
},
74+
"file_extension": ".py",
75+
"mimetype": "text/x-python",
76+
"name": "python",
77+
"nbconvert_exporter": "python",
78+
"pygments_lexer": "ipython2",
79+
"version": "2.7.6"
80+
}
81+
},
82+
"nbformat": 4,
83+
"nbformat_minor": 5
84+
}

0 commit comments

Comments
 (0)