コード例 #1
0
ファイル: __init__.py プロジェクト: travleev/serpent-tools
def depmtx(fileP):
    """
    Read the contents of the ``depmtx`` file and return contents

    .. deprecated:: 0.6.0
        Use either the :func:`~serpentTools.parsers.readDepmtx`
        or :class:`~serpentTools.DepmtxReader`

    .. note::

        If :term:`scipy` is not installed, matrix ``A`` will be full.
        This can cause some warnings or errors if sparse or
        non-sparse solvers are used.

    Parameters
    ----------
    fileP: str
        Path to depletion matrix file

    Returns
    -------
    t: float
        Length of time
    n0: :class:`numpy.ndarray`
        Initial isotopic vector
    zai: :class:`numpy.ndarray`
        String identifiers for each isotope in ``n0`` and ``n1``
    a: :class:`numpy.ndarray` or :class:`scipy.sparse.csc_matrix`
        Decay matrix. Will be sparse if scipy is installed
    n1: :class:`numpy.ndarray`
        Final isotopic vector
    """
    t, n0, zai, a, n1 = readDepmtx(fileP)
    zai = zai.astype(str)
    n0 = n0.reshape(n0.size, 1)
    n1 = n1.reshape(n1.size, 1)
    return t, n0, zai, a, n1
コード例 #2
0
 def setUpClass(cls):
     reader = DummyReader()
     (reader.deltaT, reader.n0, reader.zai, reader.depmtx,
      reader.n1) = (readDepmtx(TEST_FILE, cls.USE_SPARSE))
     cls.reader = reader