docstr: ...Test of ProxL1
          
docstr_tok: ["...","Test","of","ProxL1"]
code: def test_ProxL1(self):
      """...Test of ProxL1"""
      coeffs = self.coeffs.copy().astype(self.dtype)
  
      l_l1 = 3e-2
      t = 1.7
  
      prox = ProxL1(l_l1).astype(self.dtype)
      thresh = t * l_l1
      out = (
          np.sign(coeffs)
          * (np.abs(coeffs) - thresh)
          * (np.abs(coeffs) > thresh)
      )
      self.assertAlmostEqual(
          prox.value(coeffs),
          l_l1 * np.abs(coeffs).sum(),
          delta=self.delta,
      )
      assert_almost_equal(prox.call(coeffs, step=t), out, decimal=10)
  
      prox = ProxL1(l_l1, (3, 8)).astype(self.dtype)
      thresh = t * l_l1
      sub_coeffs = coeffs[3:8]
      out = coeffs.copy()
      out[3:8] = (
          np.sign(sub_coeffs)
          * (np.abs(sub_coeffs) - thresh)
          * (np.abs(sub_coeffs) > thresh)
      )
      self.assertAlmostEqual(
          prox.value(coeffs),
          l_l1 * np.abs(coeffs[3:8]).sum(),
          delta=self.delta,
      )
      assert_almost_equal(prox.call(coeffs, step=t), out, decimal=10)
  
      prox = ProxL1(l_l1, (3, 8), positive=True).astype(self.dtype)
      thresh = t * l_l1
      sub_coeffs = coeffs[3:8]
      out = coeffs.copy()
      out[3:8] = (
          np.sign(sub_coeffs)
          * (np.abs(sub_coeffs) - thresh)
          * (np.abs(sub_coeffs) > thresh)
      )
      idx = out[3:8] < 0
      out[3:8][idx] = 0
      self.assertAlmostEqual(
          prox.value(coeffs),
          l_l1 * np.abs(coeffs[3:8]).sum(),
          delta=self.delta,
      )
      assert_almost_equal(prox.call(coeffs, step=t), out, decimal=10)
  
file_path: tick/tick/prox/tests/prox_l1_test.py
imports: import unittest
  from numpy.testing import assert_almost_equal
  import numpy
  from tick.prox import ProxL1
  from tick.prox.tests.prox import TestProx
label_desc: Use image node_id 1 for calling the ProxL1Test obj's underlying member method code with example usage: obj.test_ProxL1() without return types