serpentTools.read

serpentTools.read(filePath, reader='infer')

Simple entry point to read a file and obtain the processed reader.

Parameters
  • filePath (str) – Path to the file to be reader

  • reader (str or callable) –

    Type of reader to use. If a string is given, then the actions described below will happen. If callable, then that function will be used with the file path as the first argument.

    String argument

    Action

    infer

    Infer the correct reader based on the file

    branch

    BranchingReader

    bumat

    BumatReader

    dep

    DepletionReader

    det

    DetectorReader

    fission

    FissionMatrixReader

    history

    HistoryReader

    microxs

    MdxReader

    results

    ResultsReader

    sensitivity

    SensitivityReader

    xsplot

    XSPlotReader

Returns

Correct subclass corresponding to the file type

Return type

serpentTools.objects.base.BaseReader

Raises
  • AttributeError – If the object created by the reader through reader(filePath) does not have a read method.

  • SerpentToolsException – If the reader could not be inferred or if the requested reader string is not supported

  • NotImplementedError – This has the ability to load in readers that may not be complete, and thus the read method may raise this error.