starting sage with no history file

46 views
Skip to first unread message

John Cremona

unread,
May 21, 2019, 7:46:41 AM5/21/19
to SAGE support
I want to run sage with no history file (it is running a script so no history of commands is needed, and I am running multiple instances in parallel, and finding that all but one show error messages that the history database is locked).

I see that ipython allows --loglevel=0 for this, but sage (from the command line) appears not to.  Am I missing something?

John Cremona

slelievre

unread,
May 21, 2019, 6:07:10 PM5/21/19
to sage-support
Possibly related:

- Sage Trac ticket 23752
  Use different history file for unit tests

- Sage Trac ticket 16372
  Intermittent test failures with IPython history

John Cremona

unread,
May 22, 2019, 4:00:34 AM5/22/19
to SAGE support
Paul Zimmermann suggested using -nodotsage, which apparently creates a temporary .sage directory which I expect would be different for different runs.  This is not ideal since currently the scripts I am running this way make use of a %runfile command in ~/.sage/initsage to load all the functions needed.

John

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/dd799185-11a1-47be-b2e2-c1636e74909e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

slelievre

unread,
May 22, 2019, 5:27:24 AM5/22/19
to sage-support
Le mercredi 22 mai 2019 10:00:34 UTC+2, John Cremona a écrit :
Paul Zimmermann suggested using -nodotsage, which apparently creates a temporary .sage directory which I expect would be different for different runs.  This is not ideal since currently the scripts I am running this way make use of a %runfile command in ~/.sage/initsage to load all the functions needed.

One can use a custom init.sage, see my answer to

- Stack Overflow question 41922740: Start cli with init.sage

The trick is just to use the SAGE_STARTUP_FILE environment variable.

Instead of just running

    $ sage

run

    $ SAGE_STARTUP_FILE=/path/to/custom/init.sage sage

John Cremona

unread,
May 22, 2019, 6:17:44 AM5/22/19
to SAGE support
Thanks Samuel, that sounds perfect.  In fact, since my init.sage only contains the line

%runfile /home/jec/ecdata/scripts/ecdb.py

it seems that I can do 

SAGE_STARTUP_FILE=%runfile /home/jec/ecdata/scripts/ecdb.py sage -nodotsage

and this will solve the issue.  I will try that.

John
 

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.

John Cremona

unread,
May 22, 2019, 6:18:38 AM5/22/19
to SAGE support
On Wed, 22 May 2019 at 11:17, John Cremona <john.c...@gmail.com> wrote:


On Wed, 22 May 2019 at 10:27, slelievre <samuel....@gmail.com> wrote:
Le mercredi 22 mai 2019 10:00:34 UTC+2, John Cremona a écrit :
Paul Zimmermann suggested using -nodotsage, which apparently creates a temporary .sage directory which I expect would be different for different runs.  This is not ideal since currently the scripts I am running this way make use of a %runfile command in ~/.sage/initsage to load all the functions needed.

One can use a custom init.sage, see my answer to

- Stack Overflow question 41922740: Start cli with init.sage

The trick is just to use the SAGE_STARTUP_FILE environment variable.

Instead of just running

    $ sage

run

    $ SAGE_STARTUP_FILE=/path/to/custom/init.sage sage

Thanks Samuel, that sounds perfect.  In fact, since my init.sage only contains the line

%runfile /home/jec/ecdata/scripts/ecdb.py

it seems that I can do 

SAGE_STARTUP_FILE=%runfile /home/jec/ecdata/scripts/ecdb.py sage -nodotsage

Of course I meant 

SAGE_STARTUP_FILE=/home/jec/ecdata/scripts/ecdb.py sage -nodotsage

John Cremona

unread,
May 22, 2019, 6:26:26 AM5/22/19
to SAGE support
On Wed, 22 May 2019 at 11:18, John Cremona <john.c...@gmail.com> wrote:


On Wed, 22 May 2019 at 11:17, John Cremona <john.c...@gmail.com> wrote:


On Wed, 22 May 2019 at 10:27, slelievre <samuel....@gmail.com> wrote:
Le mercredi 22 mai 2019 10:00:34 UTC+2, John Cremona a écrit :
Paul Zimmermann suggested using -nodotsage, which apparently creates a temporary .sage directory which I expect would be different for different runs.  This is not ideal since currently the scripts I am running this way make use of a %runfile command in ~/.sage/initsage to load all the functions needed.

One can use a custom init.sage, see my answer to

- Stack Overflow question 41922740: Start cli with init.sage

The trick is just to use the SAGE_STARTUP_FILE environment variable.

Instead of just running

    $ sage

run

    $ SAGE_STARTUP_FILE=/path/to/custom/init.sage sage

Thanks Samuel, that sounds perfect.  In fact, since my init.sage only contains the line

%runfile /home/jec/ecdata/scripts/ecdb.py

it seems that I can do 

SAGE_STARTUP_FILE=%runfile /home/jec/ecdata/scripts/ecdb.py sage -nodotsage

Of course I meant 

SAGE_STARTUP_FILE=/home/jec/ecdata/scripts/ecdb.py sage -nodotsage

3rd time lucky:

SAGE_STARTUP_FILE=/home/jec/ecdata/scripts/ecdb.py sage --nodotsage
 
works fine ( --nodotsage, not -nodotsage).  Thanks again
Reply all
Reply to author
Forward
0 new messages