You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 46c9a91
Browse filesBrowse the repository at this point in the historyBrowse files
Implement deletion of temporary variables in summarize.py (reviewed) (#1116)
* Implement deletion of temporary variables in summarize.py
Add functionality to delete temporary variables starting with '_del' from locals_d.
* addressing copilot review and adding CI testing
* updating documentation for _del feature
---------
Co-authored-by: ziocolaandrea <118041510+ziocolaandrea@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/users-guide/visualization.rst
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,15 @@ Rows with output values that begin with an alphanumeric character will be saved
36
36
37
37
Rows with output values that begin with underscores (e.g., ``_output_name``) will be stored as temporary variables in the local namespace so they can be used in following expressions. Expressions defining temporary variables can produce any data type. Users are encouraged to follow the ActivitySim convention using capitals to denote constants (e.g., ``_TEMP_CONSTANT``), though this convention is not formally enforced for summarize expressions.
38
38
39
+
Temporary variables that are no longer needed can be removed from the local
40
+
namespace, allowing their memory to be reclaimed when no other references
41
+
remain. Set the ``Output`` column to the reserved value ``_del`` and list one or more
42
+
comma-separated temporary variable names in ``Expression``. Missing names are
43
+
ignored, and the row does not create an output file. For example::
Summarize expressions can make use of several convenience functions for binning numeric Pandas Series' into quantiles, equal intervals, or manually-specified ranges. These functions are available in the local namespace used to evaluate summarize expressions (as well as for preprocessing the ``trips_merged`` table; see below), so they can be used directly in summary expressions. These functions include:
40
49
41
50
* ``quantiles``: Construct quantiles from a Series given a number of bins.
0 commit comments