<commit_before>import os
import flopy

def test_usg_disu_load():

    pthusgtest = os.path.join('..', 'examples', 'data', 'mfusg_test',
                              '01A_nestedgrid_nognc')
    fname = os.path.join(pthusgtest, 'flow.disu')
    assert os.path.isfile(fname), 'disu file not found {}'.format(fname)

    # Create the model
    m = flopy.modflow.Modflow(modelname='usgload', verbose=True)

    # Load the disu file
    disu = flopy.modflow.ModflowDisU.load(fname, m)
    assert isinstance(disu, flopy.modflow.ModflowDisU)

    # Change where model files are written
    model_ws = 'temp'
    m.change_model_ws(model_ws)

    # Write the disu file
    disu.write_file()
    assert os.path.isfile(os.path.join(model_ws, '{}.{}'.format(m.name, m.disu.extension[0]))) is True

    # Load disu file
    disu2 = flopy.modflow.ModflowDisU.load(fname, m)
    for key in disu2.__dict__.keys():
        assert disu2[key] == disu[key]

    return

if __name__ == '__main__':
    test_usg_disu_load()<commit_msg>Small adjustment to t016 auto test<commit_after>import os
import flopy
import numpy as np

def test_usg_disu_load():

    pthusgtest = os.path.join('..', 'examples', 'data', 'mfusg_test',
                              '01A_nestedgrid_nognc')
    fname = os.path.join(pthusgtest, 'flow.disu')
    assert os.path.isfile(fname), 'disu file not found {}'.format(fname)

    # Create the model
    m = flopy.modflow.Modflow(modelname='usgload', verbose=True)

    # Load the disu file
    disu = flopy.modflow.ModflowDisU.load(fname, m)
    assert isinstance(disu, flopy.modflow.ModflowDisU)

    # Change where model files are written
    model_ws = 'temp'
    m.change_model_ws(model_ws)

    # Write the disu file
    disu.write_file()
    assert os.path.isfile(os.path.join(model_ws, '{}.{}'.format(m.name, m.disu.extension[0]))) is True

    # Load disu file
    disu2 = flopy.modflow.ModflowDisU.load(fname, m)
    for (key1, value1), (key2, value2) in zip(disu2.__dict__.items(), disu.__dict__.items()):
        if isinstance(value1, flopy.utils.util_2d) or isinstance(value1, flopy.utils.util_3d):
            assert np.array_equal(value1.array, value2.array)
        else:
            assert value1 == value2

    return

if __name__ == '__main__':
    test_usg_disu_load()
{'fraction_non_alphanumeric': 0.12925764192139738, 'fraction_numerical': 0.011353711790393014, 'mean_word_length': 3.142857142857143, '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': '4783110', 'n_tokens_mistral': 860, 'n_tokens_neox': 832, 'n_words': 174}