Skip to main content

Questions tagged [persistence]

For questions about persistence, i.e., storing variable values or function definitions beyond the lifetime of individual Mathematica sessions.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Best practice to persist symbols between sessions and a problem with $Epilog [duplicate]

I often define functions like this in my notebooks: ClearAll[f]; f[a_, b_, c_] := f[a, b, c] = f[b, a, c] = somethingExpensive[a, b, c] where I use memoization to ...
JEM_Mosig's user avatar
  • 3,043
4 votes
1 answer
112 views

Once[…, "location"] adds $CellContext` to all global symbols

For certain persistence locations, such as "Notebook" or "FrontEndSession", ...
Deniz's user avatar
  • 245
0 votes
1 answer
83 views

How to count Kernel evaluations then call a function on every nth evaluation

On every nth (2) evaluation autoEval should invoke a function check[]. The thing which is supposed to listen for all ...
Jules Manson's user avatar
  • 2,467
4 votes
1 answer
71 views

How to persist in a notebook the result of an imported spreadsheet? [duplicate]

I create data table in my notebook by importing a excel spreadsheet using: ...
ALEXANDRE ARARIPE's user avatar
1 vote
1 answer
50 views

Why is LocalSymbol treated differently inside a Module scope?

Wanting to persist credentials entered via a dialog. While doing so I wanted to scope them by prepending a type to the symbol name. Came across this behavior which I find odd: ...
SEngstrom's user avatar
  • 1,719
0 votes
0 answers
66 views

Input field with a value that persists between sessions

Ultimately, I would like to have input field that will remember in front-end its last session value, while its related variable should not be local and should be dynamic. Input field will be put in a ...
Schepy's user avatar
  • 21
17 votes
2 answers
1k views

How can I make assignments persist across sessions?

Yesterday, I imported a large set of data into a Mathematica notebook and stored each imported list of numbers in a function. For example, I would map a list like ...
K. Claesson's user avatar
4 votes
1 answer
57 views

How can I see what Get restored?

Say I save variables x, y, z using ...
Paul R.'s user avatar
  • 877
2 votes
1 answer
490 views

Save trained NetChain between Mathematica sessions?

Let's say I have written a NetChain machine learning setup, trained the chain with NetTrain and obtained a model ready to ...
Kagaratsch's user avatar
  • 12.1k
16 votes
1 answer
262 views

Persistent storage for packages

How can I implement persistent storage for packages/applications? For example, how can my package have settings which persist across sessions? I have implemented this more than once in the past. ...
Szabolcs's user avatar
  • 236k
9 votes
2 answers
185 views

Problem with LocalSymbol

Bug introduced in 10.2 and fixed in 11.1 I have found that LocalSymbol will sometimes create and store persistent data in a directory different from and off the ...
m_goldberg's user avatar
  • 108k
1 vote
1 answer
246 views

Persistent memoized functions [duplicate]

I'm inspired to make use of "remembering the function values" technique from here: Functions that remember their values The only question is: how can I save the function, along with its values stored ...
James LT's user avatar
  • 313
3 votes
0 answers
89 views

Get list value without displaying it on screen [duplicate]

Having this code: ...
michelson's user avatar
  • 443
0 votes
0 answers
46 views

How can I "save" a function? [duplicate]

If I create a function, for example: ...
Geoffrey Critzer's user avatar
8 votes
3 answers
567 views

Friendly way to make previous large calculation results reusable in a new session

Very often, I need to do same calculations under different parameters for comparing the results. Every calculation may generate a large data set; for example, the calculation result of ...
matheorem's user avatar
  • 17.4k
3 votes
2 answers
524 views

How to store an InterpolatingFunction? [duplicate]

Assume I have obtained an InterpolatingFunction, say, as the result of solving of a differential equation, say, this one: ...
Alexei Boulbitch's user avatar
6 votes
3 answers
668 views

Save associations to a file and reload

I have many (say 2 for now) associations that I want to save to a file ...
mete's user avatar
  • 1,218
4 votes
1 answer
152 views

How to preserve In/Out tags like what they did in documentation files

Every evaluation generates a pair of In[n]/Out[n] signs tagged before actual input and output. Like the following: If I save the file, close it and re-open it, that In[n]/Out[n] signs will disappear (...
Naitree's user avatar
  • 1,245
5 votes
1 answer
379 views

DynamicModule inconsistent behavior; was: DynamicModule persistent UI changes

Update: I'll restate the question in hopefully more terse and clearer terms. To illustrate the issue, run this and save the resulting notebook: ...
Fallible's user avatar
  • 793
7 votes
4 answers
494 views

Are persistent variable values after the kernel is stopped possible?

Is there a way to make values of variables persistent even after the kernel is stopped? Example, if I were to set up a list for which I append new list items (such as a check ledger, as a basic ...
kale's user avatar
  • 11k
67 votes
7 answers
19k views

Saving data inside a notebook so that I don't have to run it again?

Piggybacking on this, I am somehow not fully convinced that I can't save data generated by a calculation in a mathematica file so that when I re-launch said file, I wouldn't have to run my ...
dearN's user avatar
  • 5,381
113 votes
6 answers
123k views

How do I clear all user defined symbols?

Is there some way to do this other than going to Evaluation -> Quit kernel and firing a new one up?
niklasfi's user avatar
  • 2,673
53 votes
4 answers
7k views

Saving Mathematica kernel state?

If I save a notebook, I only save what I see. That is, if I close Mathematica and reopen the notebook later, all previous calculations are lost, except for those things I've output. Now I know that ...
celtschk's user avatar
  • 19.2k