Changeset 12827


Ignore:
Timestamp:
07/30/12 14:41:52 (13 years ago)
Author:
jschierm
Message:

Fixed docstrings so that ipython could use them.

Location:
issm/trunk-jpl/src/m
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/clusters/generic.py

    r12754 r12827  
    1 """
    2 GENERIC cluster class definition
    3  
    4     Usage:
    5        cluster=generic('name','astrid','np',3);
    6        cluster=generic('name',oshostname(),'np',3,'login','username');
    7 """
    8 
    91import socket
    102import os
     
    1911
    2012class generic(object):
     13        """
     14        GENERIC cluster class definition
     15 
     16            Usage:
     17               cluster=generic('name','astrid','np',3);
     18               cluster=generic('name',oshostname(),'np',3,'login','username');
     19        """
     20
    2121        def __init__(self,*args):    # {{{
    2222
  • issm/trunk-jpl/src/m/classes/pairoptions.py

    r12661 r12827  
    1 """
    2 PAIROPTIONS class definition
     1from WriteData import *
     2
     3class pairoptions(object):
     4        """
     5        PAIROPTIONS class definition
    36 
    4     Usage:
    5        pairoptions=pairoptions();
    6        pairoptions=pairoptions('module',true,'solver',false);
    7 """
    8 
    9 from WriteData import *
    10 
    11 class pairoptions(object):
     7            Usage:
     8               pairoptions=pairoptions();
     9               pairoptions=pairoptions('module',true,'solver',false);
     10        """
     11
    1212        def __init__(self,*arg):
    1313                self.functionname = ''
  • issm/trunk-jpl/src/m/model/MatlabProcessPatch.py

    r12733 r12827  
    1 """
    2 PROCESSPATCH - create a structure from a patch
     1def MatlabProcessPatch(structure):
     2        """
     3        PROCESSPATCH - create a structure from a patch
    34 
    4     Usage:
    5        Result=ProcessPatch(Result);
    6 """
    7 
    8 def MatlabProcessPatch(structure):
     5            Usage:
     6               Result=ProcessPatch(Result);
     7        """
    98
    109        #loop over steps
  • issm/trunk-jpl/src/m/model/WriteData.py

    r12676 r12827  
    1 """
    2 WRITEDATA - write model field in binary file
    3  
    4     Usage:
    5        WriteData(fid,*args)
    6 """
    7 
    81import numpy
    92import math
     
    125
    136def WriteData(fid,*args):
     7        """
     8        WRITEDATA - write model field in binary file
     9 
     10            Usage:
     11               WriteData(fid,*args)
     12        """
     13
    1414        #process options
    1515        options=pairoptions(args)
  • issm/trunk-jpl/src/m/model/ismodelselfconsistent.py

    r12757 r12827  
    1 """
    2 ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
    3  
    4     Usage:
    5        ismodelselfconsistent(md),
    6 """
     1def ismodelselfconsistent(md):
     2        """
     3        ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
    74
    8 def ismodelselfconsistent(md):
     5            Usage:
     6               ismodelselfconsistent(md),
     7        """
    98
    109        #initialize consistency as true
  • issm/trunk-jpl/src/m/model/loadresultsfromcluster.py

    r12733 r12827  
    1 """
    2 LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
    3  
    4     Usage:
    5        md=loadresultsfromcluster(md,runtimename);
    6 """
    7 
    81import os
    92import platform
     
    125
    136def loadresultsfromcluster(md,runtimename=False):
     7        """
     8        LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
     9 
     10            Usage:
     11               md=loadresultsfromcluster(md,runtimename);
     12        """
    1413
    1514        #retrieve cluster, to be able to call its methods
  • issm/trunk-jpl/src/m/model/loadresultsfromdisk.py

    r12733 r12827  
    1 """
    2 LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"           
    3  
    4     Usage:
    5        md=loadresultsfromdisk(md=False,filename=False);
    6 """
    7 
    81import os
    92
    103def loadresultsfromdisk(md,filename):
     4        """
     5        LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"           
     6 
     7            Usage:
     8               md=loadresultsfromdisk(md=False,filename=False);
     9        """
    1110
    1211        #check number of inputs/outputs
  • issm/trunk-jpl/src/m/model/marshall.py

    r12733 r12827  
    1 """
    2 MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
    3 
    4     The routine creates a compatible binary file from @model md
    5     This binary file will be used for parallel runs in JPL-package
    6 
    7     Usage:
    8        marshall(md)
    9 """
    10 
    111from WriteData import *
    122
    133def marshall(md):
     4        """
     5        MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
     6
     7            The routine creates a compatible binary file from @model md
     8            This binary file will be used for parallel runs in JPL-package
     9
     10            Usage:
     11               marshall(md)
     12        """
     13
    1414        print "marshalling file '%s.bin'." % md.miscellaneous.name
    1515
  • issm/trunk-jpl/src/m/model/petscversion.py

    r12766 r12827  
    1 """
    2 PETSCVERSION - recover petsc version number, inside config.h file
    3  
    4     Usage:
    5         PETSC_VERSION=petscversion();
    6 """
    7 
    81import os
    92from issmdir import *
     
    114
    125def petscversion():
     6        """
     7        PETSCVERSION - recover petsc version number, inside config.h file
     8 
     9            Usage:
     10                PETSC_VERSION=petscversion();
     11        """
    1312
    1413        #default
  • issm/trunk-jpl/src/m/model/process_solve_options.py

    r12676 r12827  
    1 """
    2 DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
    3  
    4     Usage:
    5        options=process_solve_options(options)
    6  
    7     See also: SOLVE
    8 """
    9 
    101import os
    112
    123def process_solve_options(options):
     4        """
     5        DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
     6 
     7            Usage:
     8               options=process_solve_options(options)
     9 
     10            See also: SOLVE
     11        """
    1312
    1413        outoptions={}
  • issm/trunk-jpl/src/m/model/solve.py

    r12755 r12827  
    1 """
    2 SOLVE - apply solution sequence for this model
    3  
    4     Usage:
    5        md=solve(md,solutionenum,varargin)
    6        where varargin is a list of paired arguments of string OR enums
    7  
    8     solution types available comprise:
    9                  - DiagnosticSolutionEnum
    10                  - PrognosticSolutionEnum
    11                  - ThermalSolutionEnum
    12                  - SteadystateSolutionEnum
    13                  - TransientSolutionEnum...
    14                  - BalancethicknessSolutionEnum
    15                  - BedSlopeSolutionEnum
    16                  - SurfaceSlopeSolutionEnum
    17                  - HydrologySolutionEnum
    18                  - FlaimSolutionEnum
    19  
    20    extra options:
    21        - loadonly : does not solve. only load results
    22  
    23     Examples:
    24        md=solve(md,DiagnosticSolutionEnum);
    25 """
    26 
    271import datetime
    282import os
     
    304
    315def solve(md,solutionenum,*args):
     6        """
     7        SOLVE - apply solution sequence for this model
     8 
     9            Usage:
     10               md=solve(md,solutionenum,varargin)
     11               where varargin is a list of paired arguments of string OR enums
     12 
     13            solution types available comprise:
     14                         - DiagnosticSolutionEnum
     15                         - PrognosticSolutionEnum
     16                         - ThermalSolutionEnum
     17                         - SteadystateSolutionEnum
     18                         - TransientSolutionEnum...
     19                         - BalancethicknessSolutionEnum
     20                         - BedSlopeSolutionEnum
     21                         - SurfaceSlopeSolutionEnum
     22                         - HydrologySolutionEnum
     23                         - FlaimSolutionEnum
     24 
     25           extra options:
     26               - loadonly : does not solve. only load results
     27 
     28            Examples:
     29               md=solve(md,DiagnosticSolutionEnum);
     30        """
    3231
    3332        #recover and process solve options
  • issm/trunk-jpl/src/m/model/waitonlock.py

    r12676 r12827  
    1 """
    2 WAITONLOCK - wait for a file
    3  
    4     This routine will return when a file named 'filename' is written to disk.
    5     If the time limit given in input is exceeded, return 0
    6  
    7     Usage:
    8        flag=waitonlock(md,executionpath)
    9 """
    10 
    111import os
    122import socket
     
    155
    166def waitonlock(md,executionpath,login,port):
     7        """
     8        WAITONLOCK - wait for a file
     9 
     10            This routine will return when a file named 'filename' is written to disk.
     11            If the time limit given in input is exceeded, return 0
     12 
     13            Usage:
     14               flag=waitonlock(md,executionpath)
     15        """
    1716
    1817        #Get filename (lock file) and options
  • issm/trunk-jpl/src/m/utils/Cluster/parallelrange.py

    r12652 r12827  
    11#! /usr/bin/env python
    2 """
    3 PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
     2def parallelrange(rank,numprocs,globalsize):
     3        """
     4        PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
    45 
    5     Usage:
    6        i1,i2=parallelrange(rank,numprocs,globalsize)
    7 """
    8 
    9 def parallelrange(rank,numprocs,globalsize):
     6            Usage:
     7               i1,i2=parallelrange(rank,numprocs,globalsize)
     8        """
    109
    1110        #We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
  • issm/trunk-jpl/src/m/utils/OS/ismumps.py

    r12762 r12827  
    1 """
    2 %ISMUMPS - figure out if MUMPS package was compiled with ISSM
    3 %
    4 %   Usage:
    5 %       flag=ismumps();
    6 """
    7 
    81import os
    92from issmdir import *
     
    114
    125def ismumps():
     6        """
     7        ISMUMPS - figure out if MUMPS package was compiled with ISSM
     8 
     9            Usage:
     10                flag=ismumps();
     11        """
    1312
    1413        configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
  • issm/trunk-jpl/src/m/utils/OS/ispetsc.py

    r12762 r12827  
    1 """
    2 %ISPETSC - figure out if PETSC package was compiled with ISSM
    3 %
    4 %   Usage:
    5 %       flag=ispetsc();
    6 """
    7 
    81import os
    92from issmdir import *
     
    114
    125def ispetsc():
     6        """
     7        ISPETSC - figure out if PETSC package was compiled with ISSM
     8 
     9            Usage:
     10                flag=ispetsc();
     11        """
    1312
    1413        configfile=os.path.join(issmdir(),'bin','config.h')    #should find it in the install target
  • issm/trunk-jpl/src/m/utils/OS/issmscpin.py

    r12743 r12827  
    1 """
    2 SCPIN get packages from host, using scp on unix, and pscp on windows
    3  
    4     usage: scpin(host,packages,path)
    5  
    6  
    7 """
    8 
    91import socket
    102import platform
     
    157
    168def scpin(host, login,port,path, packages):
     9        """
     10        SCPIN get packages from host, using scp on unix, and pscp on windows
     11 
     12            usage: scpin(host,packages,path)
     13 
     14 
     15        """
    1716
    1817        #first get hostname
  • issm/trunk-jpl/src/m/utils/OS/issmscpout.py

    r12743 r12827  
    1 """
    2 SCPOUT send packages to a host, using scp on unix, and pscp on windows
    3  
    4     usage: scpout(host,path,packages)
    5  
    6  
    7 """
    8 
    91import socket
    102import platform
     
    157
    168def issmscpout(host,path,login,port,packages):
     9        """
     10        SCPOUT send packages to a host, using scp on unix, and pscp on windows
     11 
     12            usage: scpout(host,path,packages)
     13 
     14 
     15        """
    1716
    1817        #get hostname
  • issm/trunk-jpl/src/m/utils/OS/issmssh.py

    r12743 r12827  
    1 """
    2 ISSMSSH - wrapper for OS independent ssh command.
    3  
    4     usage:
    5        issmssh(host,command)
    6 """
    7 
    81import socket
    92import platform
     
    136
    147def issmssh(host,login,port,command):
     8        """
     9        ISSMSSH - wrapper for OS independent ssh command.
     10 
     11            usage:
     12               issmssh(host,command)
     13        """
    1514
    1615        #first get hostname
  • issm/trunk-jpl/src/m/utils/Shell/issmdir.py

    r12733 r12827  
    1 """
    2 ISSMDIR - Get ISSM_DIR environment variable
    3  
    4     Usage:
    5        ISSM_DIR=issmdir()
    6 """
    7 
    81import platform
    92import os
     
    114
    125def issmdir():
     6        """
     7        ISSMDIR - Get ISSM_DIR environment variable
     8 
     9            Usage:
     10               ISSM_DIR=issmdir()
     11        """
    1312
    1413        if not 'Windows' in platform.system():
Note: See TracChangeset for help on using the changeset viewer.