Skip to content

Commit f357fed

Browse files
committed
Custom stats in slice monitor
1 parent 5ab00bb commit f357fed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Simulation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,15 @@ def _prepare_monitors(self):
742742
# define a slice monitor
743743
from PyHEADTAIL.monitors.monitors import SliceMonitor
744744

745+
kwargs = {}
746+
if hasattr(pp, 'slice_stats_to_store'):
747+
kwargs['slice_stats_to_store'] = pp.slice_stats_to_store
745748
self.slice_monitor = SliceMonitor(
746749
"slice_evolution_%02d" % self.SimSt.present_simulation_part,
747750
pp.N_turns,
748751
self.slicer,
749752
{"Comment": "PyHDTL simulation"},
750-
write_buffer_every=write_buffer_every,
753+
write_buffer_every=write_buffer_every, **kwargs
751754
)
752755

753756
def _setup_multijob_mode(self):

0 commit comments

Comments
 (0)