예제 #1
0
    def test_release_particles(self):
        '''test that the 'id' for uncertain spill container's data is
        starting from 0'''
        spill = [
            point_line_release_spill(self.num_elements, self.start_position,
                                     self.start_time) for i in range(2)
        ]

        scp = SpillContainerPair(True)
        scp += spill[0]
        scp += spill[1]
        for sc in scp.items():
            sc.prepare_for_model_run(windage_at)
            # model sets this for each step
            sc.current_time_stamp = self.start_time
            sc.release_elements(100, self.start_time)

        for key in ['id', 'spill_num', 'age']:
            c_val = scp.LE(key)
            u_val = scp.LE(key, 'uncertain')
            assert np.all(c_val == u_val)