Пример #1
0
def test_grid_plotting():
    """ test plotting of grids """
    grids.UnitGrid([4]).plot()
    grids.UnitGrid([4, 4]).plot()

    with pytest.raises(NotImplementedError):
        grids.UnitGrid([4, 4, 4]).plot()

    grids.PolarGrid(4, 8).plot()
    grids.PolarGrid((2, 4), 8).plot()
Пример #2
0
def iter_grids():
    """ generate some test grids """
    yield grids.UnitGrid([2, 2], periodic=[True, False])
    yield grids.CartesianGrid([[0, 1]], [2], periodic=[False])
    yield grids.CylindricalGrid(2, (0, 2), (2, 2), periodic_z=True)
    yield grids.SphericalGrid(2, 2)
    yield grids.PolarGrid(2, 2)
Пример #3
0
def iter_grids():
    """ generator providing some test grids """
    for periodic in [True, False]:
        yield grids.UnitGrid([3], periodic=periodic)
        yield grids.UnitGrid([3, 3, 3], periodic=periodic)
        yield grids.CartesianGrid([[-1, 2], [0, 3]], [5, 7], periodic=periodic)
        yield grids.CylindricalGrid(3, [-1, 2], [7, 8], periodic_z=periodic)
    yield grids.PolarGrid(3, 4)
    yield grids.SphericalGrid(3, 4)
Пример #4
0
 def iter_grids():
     """ helper function iterating over different grids """
     for periodic in [True, False]:
         yield grids.UnitGrid([3, 4], periodic=periodic)
         yield grids.CartesianGrid([[0, 1], [-2, 3]], [4, 5],
                                   periodic=periodic)
         yield grids.CylindricalGrid(3, [-1, 2], [5, 7],
                                     periodic_z=periodic)
     yield grids.SphericalGrid(4, 6)
     yield grids.PolarGrid(4, 5)