Beispiel #1
0
def test_sliced_getter():
    def get_slice(slice_obj=None):
        arr = np.ones((10, 10))
        if slice_obj is None:
            slice_obj = make_slice[:, :]

        return arr[slice_obj]

    sli = SlicedGetter(get_slice)

    test = make_slice[2:-2, 2:-2]
    assert sli[test].shape == (6, 6)
Beispiel #2
0
 def force(self):
     return SlicedGetter(self.force_slice)
Beispiel #3
0
 def velocity(self):
     return SlicedGetter(self.velocity_slice)
Beispiel #4
0
 def mu(self):
     return SlicedGetter(self.mu_slice)
Beispiel #5
0
 def concentration(self):
     return SlicedGetter(self.concentration_slice)
Beispiel #6
0
 def phi(self):
     return SlicedGetter(self.phi_slice)
Beispiel #7
0
 def density(self):
     return SlicedGetter(self.density_slice)