class_docstr: Test effsize.py.
docstr: Test function compute_effsize_from_t
docstr_tok: ["Test","function","compute_effsize_from_t"]
code: def test_compute_effsize_from_t(self):
      """Test function compute_effsize_from_t"""
      tval, nx, ny = 2.90, 35, 25
      compute_effsize_from_t(tval, nx=nx, ny=ny, eftype="hedges")
      tval, N = 2.90, 60
      compute_effsize_from_t(tval, N=N, eftype="cohen")
      # Wrong desired eftype
      with pytest.raises(ValueError):
          compute_effsize_from_t(tval, nx=x, ny=y, eftype="wrong")
      # T is not a float
      with pytest.raises(ValueError):
          compute_effsize_from_t([1, 2, 3], nx=nx, ny=ny)
      # No sample size info
      with pytest.raises(ValueError):
          compute_effsize_from_t(tval)
      # Compare with Lakens spreadsheet: https://osf.io/vbdah/
      assert np.isclose(compute_effsize_from_t(1.1, N=31), 0.395131664)
      assert np.isclose(
          compute_effsize_from_t(1.74, nx=6, ny=6), 1.00458946
      )
      assert np.isclose(
          compute_effsize_from_t(2.5, nx=10, ny=14), 1.0350983
      )
  
file_path: pingouin/pingouin/tests/test_effsize.py
imports: import pytest
  import numpy
  import pandas
  from unittest import TestCase
  from scipy.stats import pearsonr, pointbiserialr
  from pingouin.effsize import compute_esci, compute_effsize, compute_effsize_from_t, compute_bootci
  from pingouin.effsize import convert_effsize
label_desc: Use image node_id 5 for calling the TestEffsize obj's underlying member method code with example usage: obj.test_compute_effsize_from_t() without return types