Ejemplo n.º 1
0
    def test22(self):

        test_results_path = self.get_path_to_results()
        output_file = os.path.join(test_results_path,
                                   "test22" + self.store_version() + ".hdf5")
        if os.path.exists(output_file):
            os.remove(output_file)

        stars = Particles(2)
        stars.x = 1.0 | units.km

        overlay = ParticlesOverlay(stars)
        overlay.y = 2.0 | units.km

        io.write_set_to_file(overlay,
                             output_file,
                             "hdf5",
                             version=self.store_version())

        loaded = io.read_set_from_file(output_file,
                                       "hdf5",
                                       close_file=True,
                                       version=self.store_version())

        self.assertEqual(loaded[0].x, 1.0 | units.km)
        self.assertEqual(loaded[1].y, 2.0 | units.km)
Ejemplo n.º 2
0
    def test22(self):
        
        test_results_path = self.get_path_to_results()
        output_file = os.path.join(test_results_path, "test22"+self.store_version()+".hdf5")
        if os.path.exists(output_file):
            os.remove(output_file)

        stars = Particles(2)
        stars.x = 1.0  | units.km
       
        overlay = ParticlesOverlay(stars)
        overlay.y = 2.0  | units.km


        io.write_set_to_file(overlay, output_file, "hdf5", version = self.store_version())
       
        loaded = io.read_set_from_file(output_file, "hdf5", close_file = True, version = self.store_version())
        
        self.assertEquals(loaded[0].x,  1.0 | units.km)
        self.assertEquals(loaded[1].y,  2.0 | units.km)