pencil.io.get_value_from_file

Exceptions

GetValueError

Common base class for all non-exit exceptions.

Functions

get_value_from_file(filename, quantity[, ...])

Use to read in a quantity from

Module Contents

exception pencil.io.get_value_from_file.GetValueError

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

pencil.io.get_value_from_file.get_value_from_file(filename, quantity, change_quantity_to=None, sim=None, filepath=None, DEBUG=False, silent=False)
Use to read in a quantity from
  • *.in

  • *.local

  • submit*, i.e. submit.sh, submit.csh, files, only works if computer is readily specified in pc.io.get_systemid

Please add further functionallity by yourself!

Parameters:
  • filename – can be “run.in”, “start.in”, “cparam.local”, path to that file is extraced from filepath or sim object

  • quantity – variable to read in from file

  • sim – put simulation object here, file will be found by filename automatically

  • filepath – normally not needed, specify here where to find the file with filename, can be a list of paths if unshure

  • DEBUG – make dry run, tell me what you would do but dont change anything!

  • silent – suppress certain output by setting True

Returns:

Returns None if not successful