Skip to content

Commit b608395

Browse files
authored
Merge pull request #454 from kengz/color
fix color scale and orca zombie processes
2 parents e52cb78 + 3d8cd6e commit b608395

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

slm_lab/experiment/analysis.py

+6
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ def analyze_session(session_spec, session_df, df_mode, plot=True):
255255
# plot graph
256256
viz.plot_session(session_spec, session_metrics, session_df, df_mode)
257257
viz.plot_session(session_spec, session_metrics, session_df, df_mode, ma=True)
258+
# manually shut down orca server to avoid zombie processes
259+
viz.pio.orca.shutdown_server()
258260
return session_metrics
259261

260262

@@ -266,6 +268,8 @@ def analyze_trial(trial_spec, session_metrics_list):
266268
# plot graphs
267269
viz.plot_trial(trial_spec, trial_metrics)
268270
viz.plot_trial(trial_spec, trial_metrics, ma=True)
271+
# manually shut down orca server to avoid zombie processes
272+
viz.pio.orca.shutdown_server()
269273
# zip files
270274
if util.get_lab_mode() == 'train':
271275
predir, _, _, _, _, _ = util.prepath_split(info_prepath)
@@ -284,6 +288,8 @@ def analyze_experiment(spec, trial_data_dict):
284288
# plot graph
285289
viz.plot_experiment(spec, experiment_df, METRICS_COLS)
286290
viz.plot_experiment_trials(spec, experiment_df, METRICS_COLS)
291+
# manually shut down orca server to avoid zombie processes
292+
viz.pio.orca.shutdown_server()
287293
# zip files
288294
predir, _, _, _, _, _ = util.prepath_split(info_prepath)
289295
zipdir = util.smart_path(predir)

slm_lab/lib/viz.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
logger = logger.get_logger(__name__)
1212
pio.templates.default = 'none' # set default white background for plots
13-
pio.orca.config.timeout = 30 # shutdown orca server after 30s inactivity
1413
# moving-average window size for plotting
1514
PLOT_MA_WINDOW = 100
1615
# warn orca failure only once
@@ -233,7 +232,7 @@ def plot_experiment(experiment_spec, experiment_df, metrics_cols):
233232
'symbol': 'circle-open-dot', 'color': strength_sr, 'opacity': 0.5,
234233
# dump first portion of colorscale that is too bright
235234
'cmin': min_strength - 0.5 * (max_strength - min_strength), 'cmax': max_strength,
236-
'colorscale': 'YlGnBu', 'reversescale': True
235+
'colorscale': 'YlGnBu', 'reversescale': False
237236
},
238237
)
239238
fig.add_trace(trace, row_idx + 1, col_idx + 1)

0 commit comments

Comments
 (0)