Ticket #12299: trac_12299_jmoldata_doctests.patch

File trac_12299_jmoldata_doctests.patch, 2.4 KB (added by gutow, 9 years ago)

complete doctest coverage in jmoldata.py and increase JmolData?.jar memory

  • sage/interfaces/jmoldata.py

    # HG changeset patch
    # User Jonathan Gutow <gutow@uwosh.edu>
    # Date 1339715397 18000
    # Node ID 022d5261b7d6128b7d12f2709f813baf24c5626a
    # Parent  0bb75312f38635ee2ef3197e6468b58bddcf87e5
    Trac 12299:Complete Doctests in jmoldata.py and increase Jmol memory.
    
    diff --git a/sage/interfaces/jmoldata.py b/sage/interfaces/jmoldata.py
    a b  
    55reads and for generating image files.
    66
    77AUTHORS:
     8Jonathan Gutow (2012-06-14): complete doctest coverage
    89Jonathan Gutow (2012-03-21): initial version
    910
    1011#*******************************************************************************
     
    2526import os
    2627
    2728class JmolDataError(Exception):
     29    """
     30    EXAMPLES::
     31        sage: from sage.interfaces.jmoldata import JmolDataError
     32        sage: print str(JmolDataError("test of error"))
     33        'test of error'
     34    """
    2835    def __init__(self, value):
    2936        self.value = value
    3037    def __str__(self):
     
    4047        3) Put data extracted from a file into a variable/string/structure to return
    4148    """
    4249    def __init__(self):
     50        """
     51        EXAMPLES::
     52        Create a JmolData object
     53        ::
     54            sage: from sage.interfaces.jmoldata import JmolData
     55            sage: JData = JmolData()
     56        """
    4357        pass
    4458
    4559    def is_jvm_available(self):
     60        """
     61        Returns True if the Java Virtual Machine is available and False if not.
     62
     63        EXAMPLES::
     64            sage: from sage.interfaces.jmoldata import JmolData
     65            sage: JData = JmolData()
     66            sage: type(JData.is_jvm_available())
     67            <type 'bool'>
     68        """
    4669        #scratch file for  Jmol errors and status
    4770        jmolscratch = os.path.expanduser("~/.sage/sage_notebook.sagenb/jmol_scratch")
    4871        if not os.path.exists(jmolscratch):
     
    136159            scratchout = os.path.join(jmolscratch,"jmolout.txt")
    137160            jout=open(scratchout,'w')
    138161            #now call the java application and write the file.
    139             result = subprocess.call(["java","-jar",jmolpath,"-iox","-g",sizeStr,"-J",launchscript,"-j",imagescript],stdout=jout)
     162            result = subprocess.call(["java","-Xms512m","-jar",jmolpath,"-iox","-g",sizeStr,"-J",launchscript,"-j",imagescript],stdout=jout)
    140163            jout.close()
    141164        else:
    142165            errStr = "Java Virtual Machine not available.\n"