pydfnWorks
python wrapper for dfnWorks
pydfnworks.dfnGen.generation.gen_input.input_helper Class Reference

Public Member Functions

def __init__ (self, params, minFracSize)
 
def curly_to_list (self, curlyList)
 ====================================================================== ## Helper Functions ## ====================================================================== ## More...
 
def list_to_curly (self, strList)
 
def has_curlys (self, line, key)
 
def value_of (self, key, writing=False)
 
def get_groups (self, line, valList, key)
 
def val_helper (self, line, valList, key)
 
def error (self, errString)
 
def warning (self, warnString)
 
def warning (self, warnString, warningFile='')
 
def is_negative (self, num)
 
def check_fam_count (self)
 
def scale (self, probList, warningFile)
 
def zero_in_std_devs (self, valList)
 
def check_min_max (self, minParam, maxParam, shape)
 
def check_mean (self, minParam, maxParam, meanParam, warningFile='')
 
def check_min_frac_size (self, valList)
 
def extract_parameters (self, line, inputIterator)
 ====================================================================== ## Parsing Functions ## ====================================================================== ## More...
 
def find_val (self, line, key, inputIterator, unfoundKeys, warningFile)
 
def find_key (self, line, unfoundKeys, warningFile)
 
def process_line (self, line, unfoundKeys, inputIterator, warningFile)
 
def verify_flag (self, value, key="", inList=False)
 ====================================================================== ## Verification ## ====================================================================== ## Note: Always provide EITHER a key (ie "stopCondition") OR inList = True/False (boolean indicating val being checked is inside a list) More...
 
def verify_float (self, value, key="", inList=False, noNeg=False)
 
def verify_int (self, value, key="", inList=False, noNeg=False)
 
def verify_list (self, valList, key, verificationFn, desiredLength, noZeros=False, noNegs=False)
 

Data Fields

 params
 
 minFracSize
 

Detailed Description

 Functions to help parse the input file and check input parameters.
    
    Attributes:
        * params (list): list of parameters specified in the input file.
        * minFracSize (float): the minimum fracture size.

Definition at line 12 of file gen_input.py.

Constructor & Destructor Documentation

◆ __init__()

def pydfnworks.dfnGen.generation.gen_input.input_helper.__init__ (   self,
  params,
  minFracSize 
)

Definition at line 19 of file gen_input.py.

Member Function Documentation

◆ check_fam_count()

def pydfnworks.dfnGen.generation.gen_input.input_helper.check_fam_count (   self)
Makes sure at least one polygon family has been defined in nFamRect or nFamEll
OR that there is a user input file for polygons.

Definition at line 116 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error(), and pydfnworks.dfnGen.generation.gen_input.input_helper.value_of().

Here is the call graph for this function:

◆ check_mean()

def pydfnworks.dfnGen.generation.gen_input.input_helper.check_mean (   self,
  minParam,
  maxParam,
  meanParam,
  warningFile = '' 
)
 Warns the user if the minimum value of a parameter is greater than the family's mean value, or if the
maximum value of the parameter is less than the family's mean value.

Definition at line 165 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.value_of(), and pydfnworks.dfnGen.generation.gen_input.input_helper.warning().

Here is the call graph for this function:

◆ check_min_frac_size()

def pydfnworks.dfnGen.generation.gen_input.input_helper.check_min_frac_size (   self,
  valList 
)
 Corrects the minimum fracture size if necessary, by looking at the values in valList.

Definition at line 182 of file gen_input.py.

◆ check_min_max()

def pydfnworks.dfnGen.generation.gen_input.input_helper.check_min_max (   self,
  minParam,
  maxParam,
  shape 
)
 Checks that the minimum parameter for a family is not greater or equal to the maximum parameter.

Definition at line 150 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error(), and pydfnworks.dfnGen.generation.gen_input.input_helper.value_of().

Here is the call graph for this function:

◆ curly_to_list()

def pydfnworks.dfnGen.generation.gen_input.input_helper.curly_to_list (   self,
  curlyList 
)

====================================================================== ## Helper Functions ## ====================================================================== ##

 '{1,2,3}' --> [1,2,3]

Definition at line 27 of file gen_input.py.

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.get_groups().

Here is the caller graph for this function:

◆ error()

◆ extract_parameters()

def pydfnworks.dfnGen.generation.gen_input.input_helper.extract_parameters (   self,
  line,
  inputIterator 
)

====================================================================== ## Parsing Functions ## ====================================================================== ##

Returns line without comments or white space.

Definition at line 195 of file gen_input.py.

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.find_val().

Here is the caller graph for this function:

◆ find_key()

def pydfnworks.dfnGen.generation.gen_input.input_helper.find_key (   self,
  line,
  unfoundKeys,
  warningFile 
)
 Input: line containing a parameter (key) preceding a ":" 
   
Returns: 
    * key -- if it has not been defined yet and is valid
    * None -- if key does not exist
    * exits -- if the key has already been defined to prevent duplicate confusion        

Definition at line 241 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error(), pydfnworks.dfnGen.generation.gen_distributions.distr.params, pydfnworks.dfnGen.generation.gen_input.input_helper.params, and pydfnworks.dfnGen.generation.gen_input.input_helper.warning().

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.process_line().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_val()

def pydfnworks.dfnGen.generation.gen_input.input_helper.find_val (   self,
  line,
  key,
  inputIterator,
  unfoundKeys,
  warningFile 
)

◆ get_groups()

def pydfnworks.dfnGen.generation.gen_input.input_helper.get_groups (   self,
  line,
  valList,
  key 
)
 extract values between { and } 

Definition at line 66 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.curly_to_list(), and pydfnworks.dfnGen.generation.gen_input.input_helper.error().

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.val_helper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_curlys()

def pydfnworks.dfnGen.generation.gen_input.input_helper.has_curlys (   self,
  line,
  key 
)
 Checks to see that every { has a matching }.

Definition at line 40 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error().

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.val_helper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_negative()

def pydfnworks.dfnGen.generation.gen_input.input_helper.is_negative (   self,
  num 
)
"returns True if num is negative, false otherwise

Definition at line 111 of file gen_input.py.

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.verify_list().

Here is the caller graph for this function:

◆ list_to_curly()

def pydfnworks.dfnGen.generation.gen_input.input_helper.list_to_curly (   self,
  strList 
)
 [1,2,3] --> '{1,2,3}'   for writing output

Definition at line 32 of file gen_input.py.

◆ process_line()

def pydfnworks.dfnGen.generation.gen_input.input_helper.process_line (   self,
  line,
  unfoundKeys,
  inputIterator,
  warningFile 
)
 Find the key in a line, and the value for that key.

Definition at line 261 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.find_key(), and pydfnworks.dfnGen.generation.gen_input.input_helper.find_val().

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.find_val().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale()

def pydfnworks.dfnGen.generation.gen_input.input_helper.scale (   self,
  probList,
  warningFile 
)
 scales list of probabilities (famProb) that doesn't add up to 1
ie [.2, .2, .4] --> [0.25, 0.25, 0.5] 

Definition at line 134 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.warning().

Here is the call graph for this function:

◆ val_helper()

def pydfnworks.dfnGen.generation.gen_input.input_helper.val_helper (   self,
  line,
  valList,
  key 
)
 pulls values from culry brackets 

Definition at line 79 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.get_groups(), and pydfnworks.dfnGen.generation.gen_input.input_helper.has_curlys().

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.find_val().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ value_of()

def pydfnworks.dfnGen.generation.gen_input.input_helper.value_of (   self,
  key,
  writing = False 
)

◆ verify_flag()

def pydfnworks.dfnGen.generation.gen_input.input_helper.verify_flag (   self,
  value,
  key = "",
  inList = False 
)

====================================================================== ## Verification ## ====================================================================== ## Note: Always provide EITHER a key (ie "stopCondition") OR inList = True/False (boolean indicating val being checked is inside a list)

Input: value - value being checked key - parameter the value belongs to inList - (Optional)

 Verify that value is either a 0 or a 1.

Definition at line 279 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error().

Here is the call graph for this function:

◆ verify_float()

def pydfnworks.dfnGen.generation.gen_input.input_helper.verify_float (   self,
  value,
  key = "",
  inList = False,
  noNeg = False 
)
 Verify that value is a positive float.

Definition at line 289 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error().

Here is the call graph for this function:

◆ verify_int()

def pydfnworks.dfnGen.generation.gen_input.input_helper.verify_int (   self,
  value,
  key = "",
  inList = False,
  noNeg = False 
)
 Verify that value is a positive integer.

Definition at line 306 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error().

Here is the call graph for this function:

◆ verify_list()

def pydfnworks.dfnGen.generation.gen_input.input_helper.verify_list (   self,
  valList,
  key,
  verificationFn,
  desiredLength,
  noZeros = False,
  noNegs = False 
)
verifies input list that come in format {0, 1, 2, 3}

Input: 
    * valList - list of values (flags, floats, or ints) corresponding to a parameter
    * key - the name of the parameter whose list is being verified
    * verificationFn - (either verifyflag, verifyfloat or verifyint) checks each list element 
    * desiredLength - how many elements are supposed to be in the list
    * noZeros - (optional) True for lists than cannot contain 0's, false if 0's are ok  
    * noNegs - (optional) True for lists than cannot contain negative numbers, false otherwise
Output:
    * returns negative value of list length to indicate incorrect length and provide meaningful error message
    * prints error and exits if a value of the wrong type is found in the list
    * returns None if successful

Definition at line 324 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.error(), and pydfnworks.dfnGen.generation.gen_input.input_helper.is_negative().

Here is the call graph for this function:

◆ warning() [1/2]

def pydfnworks.dfnGen.generation.gen_input.input_helper.warning (   self,
  warnString 
)

◆ warning() [2/2]

def pydfnworks.dfnGen.generation.gen_input.input_helper.warning (   self,
  warnString,
  warningFile = '' 
)
 print a warning to a file (currently does not work)

Definition at line 105 of file gen_input.py.

References pydfnworks.dfnGen.generation.gen_input.input_helper.warning().

Referenced by pydfnworks.dfnGen.generation.gen_input.input_helper.check_mean(), pydfnworks.dfnGen.generation.gen_input.input_helper.find_key(), and pydfnworks.dfnGen.generation.gen_input.input_helper.scale().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zero_in_std_devs()

def pydfnworks.dfnGen.generation.gen_input.input_helper.zero_in_std_devs (   self,
  valList 
)
 returns True is there is a zero in valList of standard deviations

Definition at line 144 of file gen_input.py.

Field Documentation

◆ minFracSize

pydfnworks.dfnGen.generation.gen_input.input_helper.minFracSize

Definition at line 21 of file gen_input.py.

◆ params


The documentation for this class was generated from the following file: