Utility Functions – pyne.utils
¶
This module holds some basic utility functions that are used throughout PyNE. You may find them useful as well!
All functionality may be found in the utils
module:
from pyne import utils
Utils API¶
-
pyne.utils.
failure
(s)[source]¶ Formats a fail message for printing. If on a posix system the message will be in color.
-
pyne.utils.
from_barns
(xs, units)[source]¶ Converts a cross section from barns to units.
Parameters: xs :
Cross section value in [barns].
units : str
Units flag, eg ‘b’, ‘microbarn’.
Returns: unit_xs :
Cross section value in [units].
-
pyne.utils.
message
(s)[source]¶ Formats a message for printing. If on a posix system the message will be in color.
-
pyne.utils.
remove
(path)[source]¶ Removes a path, or recursively a directory, or does nothing if path is neither a file nor a directory.
-
pyne.utils.
to_barns
(xs, units)[source]¶ Converts a cross section with units to barns.
Parameters: xs :
Cross section value in [units].
units : str
Units flag, eg ‘b’, ‘microbarn’.
Returns: barn_xs :
Cross section value in [barns].