Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Display progress information during the evaluation of an expression
ResourceFunction["MonitorEvaluate"][expr] displays progress information during the evaluation of expr. | |
ResourceFunction["MonitorEvaluate"][expr, params] displays progress according to the specification in params. |
"Text" | main progress text |
"Progress" | current progress value between 0 and 1 |
"Detail" | secondary progress text |
"ByteCountCurrent" | current processed data |
"ByteCountTotal" | total data to process |
"ElapsedTime" | time since the beginning of the evaluation |
"ItemAction" | action performed on the items |
"ItemCurrent" | amount of processed items |
"ItemName" | name of the processed items |
"ItemTotal" | number of items to process |
"Percentage" | progress percentage |
"RemainingTime" | time to the end of the evaluation |
Left|Center|Right | display only the RHS with the specified alignment |
"Progress" | display a center aligned progress bar |
"Container" | None | variable that will contain the progress info |
Deinitialization | None | expression to evaluate after expr |
"Delay" | 2 | minimal number of seconds after which the indicator is printed |
Initialization | None | expression to evaluate before expr |
"OuterUpdateInterval" | Automatic | refresh rate of the indicator panel |
"StopButton" | None | function triggered by a stop button |
"TimeEstimate" | Indeterminate | initial time estimate |
"Title" | Automatic | title used in the table |
UpdateInterval | 0.4 | refresh rate of the indicator values |
Display a generic progress panel:
In[1]:= |
Display a more detailed progress information:
In[2]:= |
Display a custom information grid:
In[3]:= |
Display the default panel:
In[4]:= |
Display custom text:
In[5]:= |
Display detail information:
In[6]:= |
Display a progress bar:
In[7]:= |
Display elapsed time:
In[8]:= |
Display remaining time:
In[9]:= |
Automatically estimate the remaining time using progress information:
In[10]:= |
In[11]:= |
Display progress percentage:
In[12]:= |
Display byte count information:
In[13]:= |
Display processed and total size:
In[14]:= |
Display processed items:
In[15]:= |
Specify the total amount of items:
In[16]:= |
Specify the item name:
In[17]:= |
Specify the action performed on the items:
In[18]:= |
Typeset the progress panel as a grid:
In[19]:= |
Mark some keys as optional:
In[20]:= |
By default, the progress panel is printed in a temporary cell:
In[21]:= |
Specify a "container" variable that will be assigned the panel:
In[22]:= |
Out[23]= |
In[24]:= |
In[25]:= |
Use integers or string to specify a container that will be automatically created and cleaned up:
In[26]:= |
Mix different containers:
In[27]:= |
By default, the progress panel appears after two seconds:
In[28]:= |
Have it appearing immediately:
In[29]:= |
Updating the interpretation of some keys require a redraw of the whole panel:
In[30]:= |
Specify how often the redraw check should be performed:
In[31]:= |
Define a behaviour for when the computation is stopped:
In[32]:= |
Define a stop behaviour using the grid layout:
In[33]:= |
The remaining time can be automatically estimated using a progress key:
In[34]:= |
In[35]:= |
If progress information cannot be obtained at runtime, some values can be driven by an initial estimate:
In[36]:= |
The default update interval is picked automatically:
In[37]:= |
Manually specify an interval:
In[38]:= |
Build a monitored version of Map:
In[39]:= |
In[40]:= |
In[41]:= |
Out[41]= |
Use a different level spec:
In[42]:= |
Out[42]= |
Create a monitored version of NDSolveValue that can return a partial solution:
In[43]:= |
Out[43]= |
Create a monitored version of NDSolveValue that show the current MemoryInUse[].
Write a function to plot the memory:
In[44]:= |
During the computation, update the progress at each step but save the memory at a lower interval:
In[45]:= |
Make the memory plot optional and use a Dynamic wrapper to force it to update only each 3 seconds:
In[46]:= |
MonitorEvaluate respects the $ProgressReporting setting:
In[47]:= |
In[48]:= |
MonitorEvaluate works similarly to Monitor:
In[49]:= |
Out[49]= |
In[50]:= |
Out[50]= |
Variables are not automatically scoped:
In[51]:= |
Out[41]= |
Use delayed assignments or scoping to avoid collisions:
In[52]:= |
Out[52]= |
In[53]:= |
Out[53]= |
This work is licensed under a Creative Commons Attribution 4.0 International License