Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 3ec8743

Browse files
committed
Used capability to send ismData directly to mericBundleGroup
1 parent 50e9555 commit 3ec8743

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/pythonScripts/opsimMovie.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ def runSlices(opsimName, metadata, simdata, fields, bins, args, opsDb, verbose=F
149149
opslicer = slicers.OpsimFieldSlicer()
150150
# Set up metricBundles to combine metrics, plotdicts and slicer.
151151
bundles = []
152+
sqlconstraint = ''
152153
for metric, plotDict in zip(metricList, plotDictList):
153-
bundles.append(metricBundles.MetricBundle(metric, opslicer, sqlconstraint='',
154+
bundles.append(metricBundles.MetricBundle(metric, opslicer, sqlconstraint=sqlconstraint,
154155
metadata=metadata, runName=opsimName,
155156
plotDict=plotDict))
156157
# Remove (default) stackers from bundles, because we've already run them above on the original data.
@@ -160,11 +161,10 @@ def runSlices(opsimName, metadata, simdata, fields, bins, args, opsDb, verbose=F
160161
# Set up metricBundleGroup to handle metrics calculation + plotting
161162
bg = metricBundles.MetricBundleGroup(bundledict, opsDb, outDir=args.outDir, resultsDb=None, saveEarly=False)
162163
# 'Hack' bundleGroup to just go ahead and run the metrics, without querying the database.
163-
bg.simData = simdatasubset
164+
simData = simdatasubset
164165
bg.fieldData = fields
165-
bg.currentBundleDict = bundledict
166-
compatibleList = bundledict.keys()
167-
bg._runCompatible(compatibleList)
166+
bg.setCurrent(sqlconstraint)
167+
bg.runCurrent(sqlconstraint = sqlconstraint, simData=simData)
168168
# Plot data each metric, for this slice of the movie, adding slicenumber as a suffix for output plots.
169169
# Plotting here, rather than automatically via sliceMetric method because we're going to rotate the sky,
170170
# and add extra legend info and figure text (for FilterColors metric).

0 commit comments

Comments
 (0)