import os
import pandas as pd
import numpy.testing as npt

from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable


def test_prep_standtable():
    data_file_name = 'raw_standtable.csv'
    plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
    expected_data_path = os.path.join(
        DATA_DIR, 'output', 'dataprepped_standtable.csv'
    )

    result = prep_standtable(plot_data)
    expected = pd.read_csv(expected_data_path, index_col=0)

    assert isinstance(result, pd.DataFrame)
    assert npt.assert_almost_equal(
        expected.values, result.values, decimal=3
    ) is None

    # regenerate output files
    # result.to_csv(expected_data_path)

import os
import pandas as pd
import numpy.testing as npt

from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable


def test_prep_standtable():
    data_file_name = 'raw_standtable.csv'
    plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
    expected_data_path = os.path.join(
        DATA_DIR, 'output', 'dataprepped_standtable.csv'
    )

    result = prep_standtable(plot_data)
    expected = pd.read_csv(expected_data_path, index_col=0)

    assert isinstance(result, pd.DataFrame)
    assert npt.assert_allclose(
        expected.values, result.values,
        rtol=0.01, atol=0.1,
        equal_nan=True
    ) is None

    # regenerate output files
    # result.to_csv(expected_data_path)

Use allclose for dataprep test
Use allclose for dataprep test

  import os
  import pandas as pd
  import numpy.testing as npt
  
  from gypsy import DATA_DIR
  from gypsy.data_prep import prep_standtable
  
  
  def test_prep_standtable():
      data_file_name = 'raw_standtable.csv'
      plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
      expected_data_path = os.path.join(
          DATA_DIR, 'output', 'dataprepped_standtable.csv'
      )
  
      result = prep_standtable(plot_data)
      expected = pd.read_csv(expected_data_path, index_col=0)
  
      assert isinstance(result, pd.DataFrame)
-     assert npt.assert_almost_equal(
+     assert npt.assert_allclose(
-         expected.values, result.values, decimal=3
+         expected.values, result.values,
+         rtol=0.01, atol=0.1,
+         equal_nan=True
      ) is None
  
      # regenerate output files
      # result.to_csv(expected_data_path)
  
Use allclose for dataprep test
## Code Before:
import os
import pandas as pd
import numpy.testing as npt

from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable


def test_prep_standtable():
    data_file_name = 'raw_standtable.csv'
    plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
    expected_data_path = os.path.join(
        DATA_DIR, 'output', 'dataprepped_standtable.csv'
    )

    result = prep_standtable(plot_data)
    expected = pd.read_csv(expected_data_path, index_col=0)

    assert isinstance(result, pd.DataFrame)
    assert npt.assert_almost_equal(
        expected.values, result.values, decimal=3
    ) is None

    # regenerate output files
    # result.to_csv(expected_data_path)

## Instruction:
Use allclose for dataprep test
## Code After:
import os
import pandas as pd
import numpy.testing as npt

from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable


def test_prep_standtable():
    data_file_name = 'raw_standtable.csv'
    plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
    expected_data_path = os.path.join(
        DATA_DIR, 'output', 'dataprepped_standtable.csv'
    )

    result = prep_standtable(plot_data)
    expected = pd.read_csv(expected_data_path, index_col=0)

    assert isinstance(result, pd.DataFrame)
    assert npt.assert_allclose(
        expected.values, result.values,
        rtol=0.01, atol=0.1,
        equal_nan=True
    ) is None

    # regenerate output files
    # result.to_csv(expected_data_path)
