Package sage :: Package server :: Module support
[hide private]
[frames] | no frames]

Module support

source code


Support for the Notebook (introspection and setup)

AUTHOR:
   * William Stein (much of this code is from IPython).



Functions [hide private]
 
init(object_directory=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a..., globs={})
Initialize \sage for use with the web notebook interface.
source code
 
setup_systems(globs) source code
 
help(obj)
Display help on s.
source code
 
get_rightmost_identifier(s) source code
 
completions(s, globs, format=False, width=90, system='None')
Return a list of completions in the context of globs.
source code
 
docstring(obj_name, globs, system='sage')
Format \var{obj_name}'s docstring for printing in \sage notebook.
source code
 
source_code(s, globs, system='sage')
Format obj's source code for printing in \sage notebook.
source code
 
tabulate(v, width=90, ncols=3) source code
 
save_session(filename) source code
 
load_session(v, filename, state) source code
 
_is_new_var(x, v) source code
 
variables(with_types=True) source code
 
syseval(system, cmd, dir=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a...) source code
 
cython_import(filename, verbose=False, compile_message=False, use_cache=False, create_local_c_file=True)
INPUT: filename -- name of a file that contains cython code OUTPUT: module -- the module that contains the compiled cython code.
source code
 
cython_import_all(filename, globals, verbose=False, compile_message=False, use_cache=False, create_local_c_file=True)
INPUT: filename -- name of a file that contains cython code OUTPUT: changes globals using the attributes of the Cython module that do not begin with an underscore.
source code
Variables [hide private]
  EMBEDDED_MODE = False
  sage_globals = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'a...
  globals_at_init = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37',...
  global_names_at_init = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7...
Function Details [hide private]

help(obj)

source code 

Display help on s.  

NOTE: This a wrapper around the builtin help.  If formats the
output as HTML without word wrap, which looks better in the
notebook.

INPUT:
    s -- Python object, module, etc. 

OUTPUT:
    prints out help about s; it's often more more extensive than foo?

TESTS:
    sage: import numpy.linalg
    sage: sage.server.support.help(numpy.linalg.norm)
    <html><table notracebacks bgcolor="#386074" cellpadding=10 cellspacing=10><tr><td bgcolor="#f5f5f5"><font color="#37546d">
    &nbsp;&nbsp;&nbsp;<a target='_new' href='cell://docs-....html'>Click to open help window</a>&nbsp;&nbsp;&nbsp;
    <br></font></tr></td></table></html>

docstring(obj_name, globs, system='sage')

source code 

Format \var{obj_name}'s docstring for printing in \sage notebook.

AUTHOR:
    -- William Stein (but partly taken from IPython for use in \sage).
    -- Extensions by Nick Alexander

source_code(s, globs, system='sage')

source code 

Format obj's source code for printing in \sage notebook.

AUTHOR:
    -- William Stein (but partly taken from IPython for use in \sage).
    -- Extensions by Nick Alexander

cython_import(filename, verbose=False, compile_message=False, use_cache=False, create_local_c_file=True)

source code 

INPUT:
    filename -- name of a file that contains cython code
    
OUTPUT:
    module -- the module that contains the compiled cython code.

Raises an \exception{ImportError} exception if anything goes wrong.

cython_import_all(filename, globals, verbose=False, compile_message=False, use_cache=False, create_local_c_file=True)

source code 

INPUT:
    filename -- name of a file that contains cython code
    
OUTPUT:
    changes globals using the attributes of the Cython module
    that do not begin with an underscore. 

Raises an \exception{ImportError} exception if anything goes wrong.


Variables Details [hide private]

sage_globals

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...

globals_at_init

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...

global_names_at_init

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...