Changeset 25485


Ignore:
Timestamp:
08/27/20 05:12:12 (5 years ago)
Author:
bdef
Message:

CHG:minor syntax

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

Legend:

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

    r25450 r25485  
    11import numpy as np
    2 
    32from checkfield import checkfield
    43from fielddisplay import fielddisplay
  • issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py

    r25165 r25485  
    1 def ismodelselfconsistent(md): #{{{
     1def ismodelselfconsistent(md):  #{{{
    22    '''
    33    ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
     
    3636#}}}
    3737
    38 def AnalysisConfiguration(solutiontype): #{{{
     38
     39def AnalysisConfiguration(solutiontype):  #{{{
    3940    '''
    4041    ANALYSISCONFIGURATION - return type of analyses, number of analyses
  • issm/trunk-jpl/src/m/qmu/helpers.py

    r25455 r25485  
    11from collections import OrderedDict
    2 from copy import deepcopy
    3 
    42import numpy as np
    53
     
    1210class Lstruct(list):
    1311    """
    14     An empty struct that can be assigned arbitrary attributes but can also be 
     12    An empty struct that can be assigned arbitrary attributes but can also be
    1513    accesed as a list. Eg. x.y = 'hello', x[:] = ['w', 'o', 'r', 'l', 'd']
    1614
    17     Note that 'x' returns the array and x.__dict__ will only return attributes 
     15    Note that 'x' returns the array and x.__dict__ will only return attributes
    1816    other than the array
    1917
    20     List-based and struct-based behaviors work normally, however they are 
    21     referenced as if the other does not exist; len(x) corresponds only to the 
    22     list component of x, len(x.a) corresponds to x.a, x.__dict__ corresponds 
     18    List-based and struct-based behaviors work normally, however they are
     19    referenced as if the other does not exist; len(x) corresponds only to the
     20    list component of x, len(x.a) corresponds to x.a, x.__dict__ corresponds
    2321    only to the non-x-list attributes
    2422
     
    6563class OrderedStruct(object):
    6664    """
    67     A form of dictionary-like structure that maintains the ordering in which 
     65    A form of dictionary-like structure that maintains the ordering in which
    6866    its fields/attributes and their corresponding values were added.
    6967
    70     OrderedDict is a similar device, however this class can be used as an 
     68    OrderedDict is a similar device, however this class can be used as an
    7169    "ordered struct/class" giving it much more flexibility in practice. It is
    7270    also easier to work with fixed valued keys in-code.
     
    9189        x = OrderedStruct('y', 5, 'z', 6)
    9290
    93     note below that the output fields as iterables are always in the same 
     91    note below that the output fields as iterables are always in the same
    9492    order as the inputs
    9593
     
    111109    ('y', 6)
    112110
    113     Note: to access internal fields use dir(x) (input fields will be included, 
     111    Note: to access internal fields use dir(x) (input fields will be included,
    114112    but are not technically internals)
    115113    """
     
    117115    def __init__(self, *args):
    118116        """
    119         Provided either nothing or a series of strings, construct a structure 
    120         that will, when accessed as a list, return its fields in the same order 
     117        Provided either nothing or a series of strings, construct a structure
     118        that will, when accessed as a list, return its fields in the same order
    121119        in which they were provided
    122120        """
     
    233231def isempty(x):
    234232    """
    235     returns true if object is +/-infinity, NaN, None, '', has length 0, or is 
    236     an array/matrix composed only of such components (includes mixtures of 
     233    returns true if object is +/-infinity, NaN, None, '', has length 0, or is
     234    an array/matrix composed only of such components (includes mixtures of
    237235    "empty" types)
    238236    """
     
    272270    """
    273271    returns a list of fields of x
    274     ignore_internals ignores all fieldnames starting with '_' and is True by 
     272    ignore_internals ignores all fieldnames starting with '_' and is True by
    275273    default
    276274    """
     
    286284    """
    287285    is y is a field of x?
    288     ignore_internals ignores all fieldnames starting with '_' and is True by 
     286    ignore_internals ignores all fieldnames starting with '_' and is True by
    289287    default
    290288    """
     
    338336
    339337    Note: will include any newlines or tabs that occur in that line,
    340     use str(findline(f, s)).strip() to remove these, str() in case result is 
     338    use str(findline(f, s)).strip() to remove these, str() in case result is
    341339    None
    342340    """
     
    354352    filler is 0.0 by default
    355353
    356     as_numpy_ndarray will return the result as a numpy.ndarray and is False by 
     354    as_numpy_ndarray will return the result as a numpy.ndarray and is False by
    357355    default
    358356
    359     Note: the filler must be either None/np.nan/float('NaN'), float/double, or 
     357    Note: the filler must be either None/np.nan/float('NaN'), float/double, or
    360358    int. other numpy and float values such as +/- np.inf will also work
    361359
Note: See TracChangeset for help on using the changeset viewer.