<commit_before>

from numpy.random import rand
from landlab import RasterModelGrid, HexModelGrid, RadialModelGrid, VoronoiDelaunayGrid

_START_ORIGIN = (10., 20.)
_MOVE_ORIGIN = (30., 45.)
def test_move_origin_raster():
    mg = RasterModelGrid(9, 5, dx=2.0, origin=_START_ORIGIN)
    assert mg._origin == _START_ORIGIN
    assert mg.x_of_node.min() == _START_ORIGIN[1]
    assert mg.y_of_node.min() == _START_ORIGIN[0]

    mg.origin = _MOVE_ORIGIN
    assert mg._origin == _MOVE_ORIGIN
    assert mg.x_of_node.min() == _MOVE_ORIGIN[1]
    assert mg.y_of_node.min() == _MOVE_ORIGIN[0]


def test_move_origin_hex():
    shapes = ["rect", "hex"]
    orientations = ["horizontal", "vertical"]

    for shape in shapes:
        for orientation in orientations:
            mg = HexModelGrid(
                9, 5, dx=2.0, origin=_START_ORIGIN, orientation=orientation, shape=shape
            )
            assert mg._origin == _START_ORIGIN
            assert mg.x_of_node[0] == _START_ORIGIN[1]
            assert mg.y_of_node[0] == _START_ORIGIN[0]

            mg.origin = _MOVE_ORIGIN
            assert mg._origin == _MOVE_ORIGIN
            assert mg.x_of_node[0] == _MOVE_ORIGIN[1]
            assert mg.y_of_node[0] == _MOVE_ORIGIN[0]


def test_move_origin_radial():
    mg = RadialModelGrid(num_shells=9, dr=10., origin_x=_START_ORIGIN[1], origin_y=_START_ORIGIN[0])

    assert mg._origin == _START_ORIGIN

    pre_move_llc = (mg.y_of_node.min(),
                    mg.x_of_node.min())

    mg.origin = _MOVE_ORIGIN
    assert mg._origin == _MOVE_ORIGIN

    post_move_llc = (mg.y_of_node.min(),
                     mg.x_of_node.min())

    actual_dydx = (post_move_llc[0] - pre_move_llc[0],
                   post_move_llc[1] - pre_move_llc[1])<commit_msg>expanding hex tests to size. <commit_after>

from numpy.random import rand
from landlab import RasterModelGrid, HexModelGrid, RadialModelGrid, VoronoiDelaunayGrid

_START_ORIGIN = (10., 20.)
_MOVE_ORIGIN = (30., 45.)

def test_move_origin_raster():
    mg = RasterModelGrid(9, 5, dx=2.0, origin=_START_ORIGIN)
    assert mg._origin == _START_ORIGIN
    assert mg.x_of_node.min() == _START_ORIGIN[1]
    assert mg.y_of_node.min() == _START_ORIGIN[0]

    mg.origin = _MOVE_ORIGIN
    assert mg._origin == _MOVE_ORIGIN
    assert mg.x_of_node.min() == _MOVE_ORIGIN[1]
    assert mg.y_of_node.min() == _MOVE_ORIGIN[0]


def test_move_origin_hex():
    shapes = ["rect", "hex"]
    orientations = ["horizontal", "vertical"]
    sizes = ( (8, 7),
              (7, 8),
              (7, 11),
              (8, 12))
    for shape in shapes:
        for orientation in orientations:
            for size in sizes:
                mg = HexModelGrid(
                    size[0], size[1], dx=2.0, origin=_START_ORIGIN, orientation=orientation, shape=shape
                )
                assert mg._origin == _START_ORIGIN
                assert mg.x_of_node[0] == _START_ORIGIN[1]
                assert mg.y_of_node[0] == _START_ORIGIN[0]

                mg.origin = _MOVE_ORIGIN
                assert mg._origin == _MOVE_ORIGIN
                assert mg.x_of_node[0] == _MOVE_ORIGIN[1]
                assert mg.y_of_node[0] == _MOVE_ORIGIN[0]


def test_move_origin_radial():
    mg = RadialModelGrid(num_shells=9, dr=10., origin_x=_START_ORIGIN[1], origin_y=_START_ORIGIN[0])

    assert mg._origin == _START_ORIGIN

    pre_move_llc = (mg.y_of_node.min(),
                    mg.x_of_node.min())

    mg.origin = _MOVE_ORIGIN
    assert mg._origin == _MOVE_ORIGIN

    post_move_llc = (mg.y_of_node.min(),
                     mg.x_of_node.min())

    actual_dydx = (post_move_llc[0] - pre_move_llc[0],
                   post_move_llc[1] - pre_move_llc[1])
{'fraction_non_alphanumeric': 0.11644754494231285, 'fraction_numerical': 0.022538234504963776, 'mean_word_length': 2.5777351247600766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6874062', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1398, 'n_words': 247}