serpentTools.seed.seedFiles

serpentTools.seed.seedFiles(inputFile, numSeeds, seed=None, outputDir=None, link=False, length=10)

Copy input file multiple times with unique seeds.

Parameters
  • inputFile (str) – Path to input file

  • numSeeds (int) – Number of files to create

  • seed (int) – Optional argument to set the seed of the builtin random number generator

  • outputDir (str) – Path to desired output directory. Files will be copied here. If the folder does not exist, try to make the directory. Assumes path relative to directory that contains the input file

  • link (bool) – If True, do not copy the full file. Instead, create a new file with 'include <inputFile>' and the new seed declaration.

  • length (int) – Number of digits for random seeds

Returns

List of the names of all files created

Return type

list

Raises
  • OSError: – If the requested input file could not be found and link does not evaluate to true.

  • ValueError: – If the number of requested seeds is not a positive integer, nor can be converted to one, or if the length of the random seeds cannot be converted to a positive integer.

  • TypeError: – Raised if the values passed to length or nseeds cannot be converted to integers with int()