Exemplo n.º 1
0
    def _start(self):
        """
        Starts the Maxima interpreter.

        EXAMPLES::

            sage: m = Maxima()
            sage: m.is_running()
            False
            sage: m._start()
            sage: m.is_running()
            True

        Test that we can use more than 256MB RAM (see :trac:`6772`)::

            sage: a = maxima(10)^(10^5)
            sage: b = a^600              # long time -- about 10-15 seconds

        """
        Expect._start(self)
        self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")

        # Don't use ! for factorials (#11539)
        self._sendline(":lisp (remprop 'mfactorial 'grind)")

        # Remove limit on the max heapsize (since otherwise it defaults
        # to 256MB with ECL).
        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
        self._eval_line('0;')

        # set random seed
        self.set_seed(self._seed)
Exemplo n.º 2
0
 def _start(self):
     """
     EXAMPLES::
     
         sage: g = Gap()
         sage: g.is_running()
         False
         sage: g._start()
         sage: g.is_running()
         True
         sage: g.quit()
     """
     if self.__use_workspace_cache and not os.path.exists(WORKSPACE):
         gap_reset_workspace()
     global first_try
     n = self._session_number
     try:
         Expect._start(self, "Failed to start GAP.")
     except Exception, msg:
         if self.__use_workspace_cache and first_try:
             print "A workspace appears to have been corrupted... automatically rebuilding (this is harmless)."
             first_try = False
             self._expect = None
             expect.failed_to_start.remove(self.name())
             gap_reset_workspace(verbose=False)
             Expect._start(self, "Failed to start GAP.")
             self._session_number = n 
             return
         raise RuntimeError, msg
Exemplo n.º 3
0
    def _start(self):
        """
        Starts the Maxima interpreter.

        EXAMPLES::

            sage: m = Maxima()
            sage: m.is_running()
            False
            sage: m._start()
            sage: m.is_running()
            True

        Test that we can use more than 256MB RAM (see trac 6722):

            sage: a = maxima(10)^(10^5)
            sage: b = a^600              # long time -- about 10-15 seconds

        """
        Expect._start(self)
        self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")

        # Don't use ! for factorials (#11539)
        self._sendline(":lisp (remprop 'mfactorial 'grind)")

        # Remove limit on the max heapsize (since otherwise it defaults
        # to 256MB with ECL).
        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
        self._eval_line('0;')
Exemplo n.º 4
0
 def _start(self):
     try:
         Expect._start(self)
     except RuntimeError:
         raise RuntimeError, "You must install the optional Kash package to use Kash from SAGE."
     # Turn off the annoying timer.
     self.eval('Time(false);')
Exemplo n.º 5
0
 def _start(self):
     try:
         Expect._start(self)
     except RuntimeError:
         raise RuntimeError, "You must install the optional Kash package to use Kash from Sage."
     # Turn off the annoying timer.
     self.eval('Time(false);')
Exemplo n.º 6
0
 def _start(self):
     """
     EXAMPLES::
     
         sage: g = Gap()
         sage: g.is_running()
         False
         sage: g._start()
         sage: g.is_running()
         True
         sage: g.quit()
     """
     if self.__use_workspace_cache and not os.path.exists(WORKSPACE):
         gap_reset_workspace()
     global first_try
     n = self._session_number
     try:
         Expect._start(self, "Failed to start GAP.")
     except Exception, msg:
         if self.__use_workspace_cache and first_try:
             print "A workspace appears to have been corrupted... automatically rebuilding (this is harmless)."
             first_try = False
             self._expect = None
             expect.failed_to_start.remove(self.name())
             gap_reset_workspace(verbose=False)
             Expect._start(self, "Failed to start GAP.")
             self._session_number = n
             return
         raise RuntimeError, msg
Exemplo n.º 7
0
Arquivo: gp.py Projeto: robertzk/lmfdb
    def _start(self, alt_message=None, block_during_init=True):
        r"""
        Restart the underlying process.

        .. note:: This is handled by the Expect class, except that we
           need to reset the breakloop configuration parameter.
        """
        Expect._start(self, alt_message=alt_message, block_during_init=block_during_init)
        self.set_default('breakloop',0)
Exemplo n.º 8
0
    def _start(self):
        """
        Starts Scilab and sets some options.

        EXAMPLES:
            sage: scilab._start()                       # optional - scilab
        """
        Expect._start(self)
        self.eval("mode(0)")
Exemplo n.º 9
0
 def _start(self, *args, **kwds):
     """
     EXAMPLES:
         sage: l = Lisp()
         sage: l.is_running()
         False
         sage: l._start()
         sage: l.is_running()
         True
     """
     Expect._start(self, *args, **kwds)
     self.__in_seq = 1
Exemplo n.º 10
0
 def _start(self, *args, **kwds):
     """
     EXAMPLES:
         sage: l = Lisp()
         sage: l.is_running()
         False
         sage: l._start()
         sage: l.is_running()
         True
     """
     Expect._start(self, *args, **kwds)
     self.__in_seq = 1
Exemplo n.º 11
0
 def _start(self, alt_message=None, block_during_init=True):
     Expect._start(self, alt_message, block_during_init)
     # disable timer
     self._eval_line('default(timer,0);')
     # disable the break loop, otherwise gp will seem to hang on errors
     self._eval_line('default(breakloop,0);')
     # list of directories where gp will look for scripts (only current working directory)
     self._eval_line('default(path,".");')
     # location of elldata, seadata, galdata
     self._eval_line('default(datadir, "$SAGE_LOCAL/share/pari");')
     # executable for gp ?? help
     self._eval_line('default(help, "$SAGE_LOCAL/bin/gphelp -detex");')
     # logfile disabled since Expect already logs
     self._eval_line('default(log,0);')
Exemplo n.º 12
0
 def _start(self, alt_message=None, block_during_init=True):
     Expect._start(self, alt_message, block_during_init)
     # disable timer
     self._eval_line('default(timer,0);')
     # disable the break loop, otherwise gp will seem to hang on errors
     self._eval_line('default(breakloop,0);')
     # list of directories where gp will look for scripts (only current working directory)
     self._eval_line('default(path,".");')
     # location of elldata, seadata, galdata
     self._eval_line('default(datadir, "$SAGE_LOCAL/share/pari");')
     # executable for gp ?? help
     self._eval_line('default(help, "$SAGE_LOCAL/bin/gphelp -detex");')
     # logfile disabled since Expect already logs
     self._eval_line('default(log,0);')
Exemplo n.º 13
0
    def _start(self):
        """
        Starts the Octave process.

        EXAMPLES::

            sage: o = Octave()    # optional - octave
            sage: o.is_running()  # optional - octave
            False
            sage: o._start()      # optional - octave
            sage: o.is_running()  # optional - octave
            True
        """
        Expect._start(self)
        self.eval("page_screen_output=0;")
        self.eval("format none;")
Exemplo n.º 14
0
 def _start(self):
     """
     Starts the Octave process.
     
     EXAMPLES::
     
         sage: o = Octave()    # optional - octave
         sage: o.is_running()  # optional - octave
         False
         sage: o._start()      # optional - octave
         sage: o.is_running()  # optional - octave
         True
     """
     Expect._start(self)
     self.eval("page_screen_output=0;")
     self.eval("format none;")
Exemplo n.º 15
0
 def _start(self):
     """
     Start the Axiom interpreter.
     
     EXAMPLES::
     
         sage: a = Axiom()
         sage: a.is_running()
         False
         sage: a._start()     #optional - axiom
         sage: a.is_running() #optional - axiom
         True
         sage: a.quit()       #optional - axiom
     """
     Expect._start(self)
     out = self._eval_line(')set functions compile on', reformat=False)
     out = self._eval_line(')set output length 245', reformat=False)
     out = self._eval_line(')set message autoload off', reformat=False)
Exemplo n.º 16
0
 def _start(self):
     """
     Start the Axiom interpreter.
     
     EXAMPLES::
     
         sage: a = Axiom()
         sage: a.is_running()
         False
         sage: a._start()     #optional - axiom
         sage: a.is_running() #optional - axiom
         True
         sage: a.quit()       #optional - axiom
     """
     Expect._start(self)
     out = self._eval_line(')set functions compile on', reformat=False)
     out = self._eval_line(')set output length 245', reformat=False)
     out = self._eval_line(')set message autoload off', reformat=False)
Exemplo n.º 17
0
 def _start(self):
     Expect._start(self)
     self.locals = sage_eval('globals()', cmds='load "%s"'%(nlgf_dir + 'prelude.sage'))
Exemplo n.º 18
0
 def _start(self):
     Expect._start(self)