Exemplo n.º 1
0
    def ts(self):
        """Return all the available timeseries in the data.

        :returns: Interface to all the timeseries in the directory.
        :rtype: :py:class:`~.ScalarsDir`
        """
        return cactus_scalars.ScalarsDir(self)
Exemplo n.º 2
0
    def test_ScalarsDir(self):

        # Not a SimDir
        with self.assertRaises(TypeError):
            cs.ScalarsDir(0)

        scaldir = cs.ScalarsDir(sd.SimDir("tests/tov"))

        # Check that the getter (and []) work
        self.assertEqual(scaldir["average"].reduction_type, "average")
        self.assertEqual(scaldir.get("infnorm").reduction_type, "infnorm")
        self.assertIsNone(scaldir.get("bubu", default=None))

        self.assertIs(scaldir["maximum"], scaldir["max"])
        self.assertIs(scaldir["minimum"], scaldir["min"])

        # Check string representation
        # (this is a very weak check...)
        self.assertIn("io_count", scaldir.__str__())