<commit_before>
import pyroomacoustics as pra

def test_room_is_inside():

    # This was a problematic case
    # if the source is placed at the same height as one of the corners
    # the test would fail, even though the source is in the room

    floorplan = [ [0, 6, 6, 2, 0],
                  [0, 0, 5, 5, 3] ]

    source_loc = [ 2, 3 ] # same y-coordinate as the corner at [0, 3]

    room = pra.Room.from_corners(floorplan)
    room.add_source(source_loc)

    assert room.is_inside([0,0], include_borders=True)
    assert not room.is_inside([0,0], include_borders=False)

    assert room.is_inside([3,0], include_borders=True)
    assert not room.is_inside([3,0], include_borders=False)

    assert room.is_inside([0,1], include_borders=True)
    assert not room.is_inside([0,1], include_borders=False)

    # now test in 3D
    room.extrude(4.)

    assert room.is_inside([2, 3, 1.7])

    assert not room.is_inside([0.5, 4, 1.8])

    assert not room.is_inside([0.5, 4, 1.8])

    assert room.is_inside([0,0,0], include_borders=True)
    assert not room.is_inside([0,0,0], include_borders=False)

    assert room.is_inside([3,0,0], include_borders=True)
    assert not room.is_inside([3,0,0], include_borders=False)

    assert room.is_inside([0,1,0], include_borders=True)
    assert not room.is_inside([0,1,0], include_borders=False)

    assert room.is_inside([3,2,0], include_borders=True)
    assert not room.is_inside([3,2,0], include_borders=False)

    assert room.is_inside([1,4,3], include_borders=True)
    assert not room.is_inside([1,4,3], include_borders=False)

    assert not room.is_inside([2,2,7])
    assert not room.is_inside([2,2,-7])

if __name__ == '__main__':

    test_room_is_inside()<commit_msg>A test was expecting the wrong result<commit_after>
import pyroomacoustics as pra

def test_room_is_inside():

    # This was a problematic case
    # if the source is placed at the same height as one of the corners
    # the test would fail, even though the source is in the room

    floorplan = [ [0, 6, 6, 2, 0],
                  [0, 0, 5, 5, 3] ]

    source_loc = [ 2, 3 ] # same y-coordinate as the corner at [0, 3]

    room = pra.Room.from_corners(floorplan)
    room.add_source(source_loc)

    assert room.is_inside([0,0], include_borders=True)
    assert not room.is_inside([0,0], include_borders=False)

    assert room.is_inside([3,0], include_borders=True)
    assert not room.is_inside([3,0], include_borders=False)

    assert room.is_inside([0,1], include_borders=True)
    assert not room.is_inside([0,1], include_borders=False)

    # now test in 3D
    room.extrude(4.)

    assert room.is_inside([2, 3, 1.7])

    assert not room.is_inside([0.5, 4, 1.8])

    assert not room.is_inside([0.5, 4, 1.8])

    assert room.is_inside([0,0,0], include_borders=True)
    assert not room.is_inside([0,0,0], include_borders=False)

    assert room.is_inside([3,0,0], include_borders=True)
    assert not room.is_inside([3,0,0], include_borders=False)

    assert room.is_inside([0,1,0], include_borders=True)
    assert not room.is_inside([0,1,0], include_borders=False)

    assert room.is_inside([3,2,0], include_borders=True)
    assert not room.is_inside([3,2,0], include_borders=False)

    assert not room.is_inside([1,4,3], include_borders=True)
    assert not room.is_inside([1,4,3], include_borders=False)

    assert not room.is_inside([2,2,7])
    assert not room.is_inside([2,2,-7])

if __name__ == '__main__':

    test_room_is_inside()
{'fraction_non_alphanumeric': 0.13386727688787187, 'fraction_numerical': 0.04462242562929062, 'mean_word_length': 3.870473537604457, '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': '6193050', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1267, 'n_words': 302}