class_docstr: Test suite for generate_swarm() method
class_docstr_tok: ["Test","suite","for","generate_swarm","(",")","method"]
docstr: Test if method returns expected values
docstr_tok: ["Test","if","method","returns","expected","values"]
code: def test_return_values(self, bounds, center):
      """Test if method returns expected values"""
      pos = P.generate_swarm(
          n_particles=2, dimensions=3, bounds=bounds, center=center
      )
      if bounds is None:
          min_bounds, max_bounds = (0.0, 1.00)
      else:
          min_bounds, max_bounds = bounds
      lower_bound = center * np.array(min_bounds)
      upper_bound = center * np.array(max_bounds)
      assert (pos <= upper_bound).all() and (pos >= lower_bound).all()
  
file_path: pyswarms/tests/backend/test_generators.py
imports: import numpy
  import pytest
  import pyswarms.backend
label_desc: Use image node_id 1 for calling the TestGenerateSwarm obj's underlying member method code with example usage: obj.test_return_values(bounds, center) without return types