Mock Version: 3.5 Mock Version: 3.5 Mock Version: 3.5 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-pyswarms.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-573599-25938/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-pyswarms.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1674172800 Wrote: /builddir/build/SRPMS/python-pyswarms-1.3.0-13.fc38.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/python-pyswarms.spec'], chrootPath='/var/lib/mock/f38-build-side-42-init-devel-573599-25938/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/python-pyswarms.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1674172800 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.IXnazO + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf pyswarms-1.3.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/pyswarms-1.3.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd pyswarms-1.3.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/bin/git init -q + /usr/bin/git config user.name rpm-build + /usr/bin/git config user.email '' + /usr/bin/git config gc.auto 0 + /usr/bin/git add --force . + /usr/bin/git commit -q --allow-empty -a --author 'rpm-build ' -m 'python-pyswarms-1.3.0 base' + /usr/bin/git checkout --track -b rpm-build Switched to a new branch 'rpm-build' branch 'rpm-build' set up to track 'master'. + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/Patch1.patch + /usr/bin/git apply --index --reject - Checking patch docs/conf.py... Applied patch docs/conf.py cleanly. + /usr/bin/git commit -q -m Patch1.patch --author 'rpm-build ' + rm -rf pyswarms.egg-info + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.SUSoRp + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd pyswarms-1.3.0 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -sP' running build running build_py creating build creating build/lib creating build/lib/pyswarms copying pyswarms/__init__.py -> build/lib/pyswarms creating build/lib/pyswarms/discrete copying pyswarms/discrete/binary.py -> build/lib/pyswarms/discrete copying pyswarms/discrete/__init__.py -> build/lib/pyswarms/discrete creating build/lib/pyswarms/backend copying pyswarms/backend/handlers.py -> build/lib/pyswarms/backend copying pyswarms/backend/operators.py -> build/lib/pyswarms/backend copying pyswarms/backend/swarms.py -> build/lib/pyswarms/backend copying pyswarms/backend/generators.py -> build/lib/pyswarms/backend copying pyswarms/backend/__init__.py -> build/lib/pyswarms/backend creating build/lib/pyswarms/base copying pyswarms/base/base_discrete.py -> build/lib/pyswarms/base copying pyswarms/base/base_single.py -> build/lib/pyswarms/base copying pyswarms/base/__init__.py -> build/lib/pyswarms/base creating build/lib/pyswarms/utils copying pyswarms/utils/__init__.py -> build/lib/pyswarms/utils creating build/lib/pyswarms/single copying pyswarms/single/local_best.py -> build/lib/pyswarms/single copying pyswarms/single/global_best.py -> build/lib/pyswarms/single copying pyswarms/single/general_optimizer.py -> build/lib/pyswarms/single copying pyswarms/single/__init__.py -> build/lib/pyswarms/single creating build/lib/pyswarms/backend/topology copying pyswarms/backend/topology/von_neumann.py -> build/lib/pyswarms/backend/topology copying pyswarms/backend/topology/random.py -> build/lib/pyswarms/backend/topology copying pyswarms/backend/topology/ring.py -> build/lib/pyswarms/backend/topology copying pyswarms/backend/topology/star.py -> build/lib/pyswarms/backend/topology copying pyswarms/backend/topology/base.py -> build/lib/pyswarms/backend/topology copying pyswarms/backend/topology/pyramid.py -> build/lib/pyswarms/backend/topology copying pyswarms/backend/topology/__init__.py -> build/lib/pyswarms/backend/topology creating build/lib/pyswarms/utils/plotters copying pyswarms/utils/plotters/plotters.py -> build/lib/pyswarms/utils/plotters copying pyswarms/utils/plotters/formatters.py -> build/lib/pyswarms/utils/plotters copying pyswarms/utils/plotters/__init__.py -> build/lib/pyswarms/utils/plotters creating build/lib/pyswarms/utils/reporter copying pyswarms/utils/reporter/reporter.py -> build/lib/pyswarms/utils/reporter copying pyswarms/utils/reporter/__init__.py -> build/lib/pyswarms/utils/reporter creating build/lib/pyswarms/utils/functions copying pyswarms/utils/functions/single_obj.py -> build/lib/pyswarms/utils/functions copying pyswarms/utils/functions/__init__.py -> build/lib/pyswarms/utils/functions creating build/lib/pyswarms/utils/decorators copying pyswarms/utils/decorators/__init__.py -> build/lib/pyswarms/utils/decorators copying pyswarms/utils/decorators/decorators.py -> build/lib/pyswarms/utils/decorators creating build/lib/pyswarms/utils/search copying pyswarms/utils/search/random_search.py -> build/lib/pyswarms/utils/search copying pyswarms/utils/search/grid_search.py -> build/lib/pyswarms/utils/search copying pyswarms/utils/search/__init__.py -> build/lib/pyswarms/utils/search copying pyswarms/utils/search/base_search.py -> build/lib/pyswarms/utils/search creating build/lib/tests creating build/lib/tests/backend copying tests/backend/test_generators.py -> build/lib/tests/backend copying tests/backend/test_handlers.py -> build/lib/tests/backend copying tests/backend/conftest.py -> build/lib/tests/backend copying tests/backend/__init__.py -> build/lib/tests/backend copying tests/backend/test_operators.py -> build/lib/tests/backend creating build/lib/tests/utils copying tests/utils/__init__.py -> build/lib/tests/utils creating build/lib/tests/optimizers copying tests/optimizers/abc_test_discrete_optimizer.py -> build/lib/tests/optimizers copying tests/optimizers/test_local_best.py -> build/lib/tests/optimizers copying tests/optimizers/test_binary.py -> build/lib/tests/optimizers copying tests/optimizers/test_verbose.py -> build/lib/tests/optimizers copying tests/optimizers/test_tolerance.py -> build/lib/tests/optimizers copying tests/optimizers/test_global_best.py -> build/lib/tests/optimizers copying tests/optimizers/__init__.py -> build/lib/tests/optimizers copying tests/optimizers/abc_test_optimizer.py -> build/lib/tests/optimizers copying tests/optimizers/test_general_optimizer.py -> build/lib/tests/optimizers creating build/lib/tests/backend/topology copying tests/backend/topology/test_von_neumann.py -> build/lib/tests/backend/topology copying tests/backend/topology/test_ring.py -> build/lib/tests/backend/topology copying tests/backend/topology/test_star.py -> build/lib/tests/backend/topology copying tests/backend/topology/test_pyramid.py -> build/lib/tests/backend/topology copying tests/backend/topology/test_random.py -> build/lib/tests/backend/topology copying tests/backend/topology/abc_test_topology.py -> build/lib/tests/backend/topology copying tests/backend/topology/conftest.py -> build/lib/tests/backend/topology copying tests/backend/topology/__init__.py -> build/lib/tests/backend/topology creating build/lib/tests/utils/plotters copying tests/utils/plotters/test_plotters.py -> build/lib/tests/utils/plotters copying tests/utils/plotters/conftest.py -> build/lib/tests/utils/plotters copying tests/utils/plotters/__init__.py -> build/lib/tests/utils/plotters creating build/lib/tests/utils/functions copying tests/utils/functions/test_singleobj_returndims.py -> build/lib/tests/utils/functions copying tests/utils/functions/test_singleobj_bounds.py -> build/lib/tests/utils/functions copying tests/utils/functions/conftest.py -> build/lib/tests/utils/functions copying tests/utils/functions/__init__.py -> build/lib/tests/utils/functions copying tests/utils/functions/test_singleobj_dims.py -> build/lib/tests/utils/functions copying tests/utils/functions/test_singleobj_return.py -> build/lib/tests/utils/functions creating build/lib/tests/utils/decorators copying tests/utils/decorators/test_decorators.py -> build/lib/tests/utils/decorators copying tests/utils/decorators/conftest.py -> build/lib/tests/utils/decorators copying tests/utils/decorators/__init__.py -> build/lib/tests/utils/decorators creating build/lib/tests/utils/search copying tests/utils/search/test_randomsearch.py -> build/lib/tests/utils/search copying tests/utils/search/test_gridsearch.py -> build/lib/tests/utils/search copying tests/utils/search/conftest.py -> build/lib/tests/utils/search copying tests/utils/search/__init__.py -> build/lib/tests/utils/search running egg_info creating pyswarms.egg-info writing pyswarms.egg-info/PKG-INFO writing dependency_links to pyswarms.egg-info/dependency_links.txt writing requirements to pyswarms.egg-info/requires.txt writing top-level names to pyswarms.egg-info/top_level.txt writing manifest file 'pyswarms.egg-info/SOURCES.txt' reading manifest file 'pyswarms.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' warning: no files found matching '*.jpg' under directory 'docs' adding license file 'LICENSE' adding license file 'AUTHORS.rst' writing manifest file 'pyswarms.egg-info/SOURCES.txt' + PYTHONPATH=/builddir/build/BUILD/pyswarms-1.3.0 + sphinx-build-3 docs html Running Sphinx v5.3.0 making output directory... done WARNING: html_static_path entry '_static' does not exist loading intersphinx inventory from https://docs.python.org/objects.inv... loading intersphinx inventory from http://matplotlib.org/objects.inv... loading intersphinx inventory from http://docs.scipy.org/doc/numpy/objects.inv... loading intersphinx inventory from https://docs.scipy.org/doc/scipy/reference/objects.inv... WARNING: failed to reach any of the inventories with the following issues: intersphinx inventory 'http://docs.scipy.org/doc/numpy/objects.inv' not fetchable due to : HTTPConnectionPool(host='docs.scipy.org', port=80): Max retries exceeded with url: /doc/numpy/objects.inv (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) WARNING: failed to reach any of the inventories with the following issues: intersphinx inventory 'http://matplotlib.org/objects.inv' not fetchable due to : HTTPConnectionPool(host='matplotlib.org', port=80): Max retries exceeded with url: /objects.inv (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) WARNING: failed to reach any of the inventories with the following issues: intersphinx inventory 'https://docs.scipy.org/doc/scipy/reference/objects.inv' not fetchable due to : HTTPSConnectionPool(host='docs.scipy.org', port=443): Max retries exceeded with url: /doc/scipy/reference/objects.inv (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) WARNING: failed to reach any of the inventories with the following issues: intersphinx inventory 'https://docs.python.org/objects.inv' not fetchable due to : HTTPSConnectionPool(host='docs.python.org', port=443): Max retries exceeded with url: /objects.inv (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) building [mo]: targets for 0 po files that are out of date building [html]: targets for 28 source files that are out of date updating environment: [new config] 28 added, 0 changed, 0 removed reading sources... [ 3%] api/_pyswarms.backend reading sources... [ 7%] api/_pyswarms.base.classes reading sources... [ 10%] api/_pyswarms.optimizers reading sources... [ 14%] api/_pyswarms.utils reading sources... [ 17%] api/pyswarms.backend reading sources... [ 21%] api/pyswarms.base reading sources... [ 25%] api/pyswarms.discrete reading sources... [ 28%] api/pyswarms.handlers reading sources... [ 32%] api/pyswarms.single reading sources... [ 35%] api/pyswarms.swarms reading sources... [ 39%] api/pyswarms.topology reading sources... [ 42%] api/pyswarms.utils.decorators reading sources... [ 46%] api/pyswarms.utils.functions reading sources... [ 50%] api/pyswarms.utils.plotters 2023-05-05 09:18:34,934 - matplotlib.font_manager - INFO - generated new fontManager reading sources... [ 53%] api/pyswarms.utils.reporter reading sources... [ 57%] api/pyswarms.utils.search reading sources... [ 60%] authors reading sources... [ 64%] contributing reading sources... [ 67%] dev.api reading sources... [ 71%] dev.loop reading sources... [ 75%] dev.optimizer reading sources... [ 78%] features reading sources... [ 82%] history reading sources... [ 85%] index reading sources... [ 89%] installation reading sources... [ 92%] intro reading sources... [ 96%] tutorials reading sources... [100%] usecases /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/base/base_single.py:docstring of pyswarms.base.base_single.SwarmOptimizer.__init__:21: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/base/base_discrete.py:docstring of pyswarms.base.base_discrete.DiscreteSwarmOptimizer.__init__:32: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/base/base_discrete.py:docstring of pyswarms.base.base_discrete.DiscreteSwarmOptimizer.__init__:64: WARNING: duplicate object description of pyswarms.base.base_discrete.DiscreteSwarmOptimizer.options, other instance in api/pyswarms.base, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/discrete/binary.py:docstring of pyswarms.discrete.binary.BinaryPSO.__init__:19: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers:1: WARNING: duplicate object description of pyswarms.backend.handlers, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.BoundaryHandler:1: WARNING: duplicate object description of pyswarms.backend.handlers.BoundaryHandler, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.BoundaryHandler.intermediate:1: WARNING: duplicate object description of pyswarms.backend.handlers.BoundaryHandler.intermediate, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.BoundaryHandler.nearest:1: WARNING: duplicate object description of pyswarms.backend.handlers.BoundaryHandler.nearest, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.BoundaryHandler.periodic:1: WARNING: duplicate object description of pyswarms.backend.handlers.BoundaryHandler.periodic, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.BoundaryHandler.random:1: WARNING: duplicate object description of pyswarms.backend.handlers.BoundaryHandler.random, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.BoundaryHandler.reflective:1: WARNING: duplicate object description of pyswarms.backend.handlers.BoundaryHandler.reflective, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.BoundaryHandler.shrink:1: WARNING: duplicate object description of pyswarms.backend.handlers.BoundaryHandler.shrink, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.HandlerMixin:1: WARNING: duplicate object description of pyswarms.backend.handlers.HandlerMixin, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.OptionsHandler:1: WARNING: duplicate object description of pyswarms.backend.handlers.OptionsHandler, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.OptionsHandler.exp_decay:1: WARNING: duplicate object description of pyswarms.backend.handlers.OptionsHandler.exp_decay, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.OptionsHandler.lin_variation:1: WARNING: duplicate object description of pyswarms.backend.handlers.OptionsHandler.lin_variation, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.OptionsHandler.nonlin_mod:1: WARNING: duplicate object description of pyswarms.backend.handlers.OptionsHandler.nonlin_mod, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.OptionsHandler.random:1: WARNING: duplicate object description of pyswarms.backend.handlers.OptionsHandler.random, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.VelocityHandler:1: WARNING: duplicate object description of pyswarms.backend.handlers.VelocityHandler, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.VelocityHandler.adjust:1: WARNING: duplicate object description of pyswarms.backend.handlers.VelocityHandler.adjust, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.VelocityHandler.invert:1: WARNING: duplicate object description of pyswarms.backend.handlers.VelocityHandler.invert, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.VelocityHandler.unmodified:1: WARNING: duplicate object description of pyswarms.backend.handlers.VelocityHandler.unmodified, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/backend/handlers.py:docstring of pyswarms.backend.handlers.VelocityHandler.zero:1: WARNING: duplicate object description of pyswarms.backend.handlers.VelocityHandler.zero, other instance in api/pyswarms.backend, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/global_best.py:docstring of pyswarms.single.global_best.GlobalBestPSO.__init__:19: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/local_best.py:docstring of pyswarms.single.local_best:55: WARNING: Duplicate explicit target name: "ijcnn1995". /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/local_best.py:docstring of pyswarms.single.local_best.LocalBestPSO.__init__:74: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.single.rst:27: WARNING: Title underline too short. pyswarms.single.general_optimizer module --------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.single.rst:27: WARNING: Title underline too short. pyswarms.single.general_optimizer module --------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:51: WARNING: Duplicate explicit target name: "ijcnn1995". /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:1: WARNING: Block quote ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer.GeneralOptimizerPSO.__init__:20: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:7: WARNING: Bullet list ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer.GeneralOptimizerPSO.__init__:30: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:13: WARNING: Block quote ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer.GeneralOptimizerPSO.__init__:35: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:19: WARNING: Block quote ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer.GeneralOptimizerPSO.__init__:41: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:25: WARNING: Inline interpreted text or phrase reference start-string without end-string. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer.GeneralOptimizerPSO.__init__:50: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:10: WARNING: Bullet list ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/local_best.py:docstring of pyswarms.single.local_best:55: WARNING: duplicate citation IJCNN1995, other instance in /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.single.rst /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/single/general_optimizer.py:docstring of pyswarms.single.general_optimizer:51: WARNING: duplicate citation IJCNN1995, other instance in /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.single.rst /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.topology.rst:40: WARNING: Title underline too short. pyswarms.backend.topology.von_neumann module -------------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.topology.rst:40: WARNING: Title underline too short. pyswarms.backend.topology.von_neumann module -------------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.topology.rst:49: WARNING: Title underline too short. pyswarms.backend.topology.pyramid module -------------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.topology.rst:49: WARNING: Title underline too short. pyswarms.backend.topology.pyramid module -------------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.topology.rst:58: WARNING: Title underline too short. pyswarms.backend.topology.random module -------------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.topology.rst:58: WARNING: Title underline too short. pyswarms.backend.topology.random module -------------------------------------- /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/utils/decorators/__init__.py:docstring of pyswarms.utils.decorators:5: ERROR: Error in "code-block" directive: maximum 1 argument(s) allowed, 7 supplied. .. code-block:: python import pyswarms import numpy as np @pyswarms.cost def cost_func(x): cost = np.abs(np.sum(x)) return cost looking for now-outdated files... none found pickling environment... /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/utils/functions/single_obj.py:docstring of pyswarms.utils.functions.single_obj:9: CRITICAL: Missing matching underline for section title overline. ------ ValueError When the input is out of bounds with respect to the function /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/utils/functions/single_obj.py:docstring of pyswarms.utils.functions.single_obj.bukin6:5: ERROR: Unexpected indentation. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/utils/functions/single_obj.py:docstring of pyswarms.utils.functions.single_obj:3: WARNING: Definition list ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/utils/functions/single_obj.py:docstring of pyswarms.utils.functions.single_obj:3: WARNING: Definition list ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/utils/functions/single_obj.py:docstring of pyswarms.utils.functions.single_obj:3: WARNING: Definition list ends without a blank line; unexpected unindent. /builddir/build/BUILD/pyswarms-1.3.0/pyswarms/utils/plotters/formatters.py:docstring of pyswarms.utils.plotters.formatters.Mesher:53: WARNING: duplicate object description of pyswarms.utils.plotters.formatters.Mesher.limits, other instance in api/pyswarms.utils.plotters, use :noindex: for one of them /builddir/build/BUILD/pyswarms-1.3.0/docs/intro.rst:74: WARNING: duplicate citation IJCNN1995, other instance in /builddir/build/BUILD/pyswarms-1.3.0/docs/api/pyswarms.single.rst /builddir/build/BUILD/pyswarms-1.3.0/docs/tutorials.rst:7: WARNING: toctree contains reference to nonexisting document 'examples/tutorials/basic_optimization' /builddir/build/BUILD/pyswarms-1.3.0/docs/tutorials.rst:7: WARNING: toctree contains reference to nonexisting document 'examples/tutorials/custom_optimization_loop' /builddir/build/BUILD/pyswarms-1.3.0/docs/tutorials.rst:7: WARNING: toctree contains reference to nonexisting document 'examples/tutorials/visualization' /builddir/build/BUILD/pyswarms-1.3.0/docs/usecases.rst:7: WARNING: toctree contains reference to nonexisting document 'examples/usecases/train_neural_network' /builddir/build/BUILD/pyswarms-1.3.0/docs/usecases.rst:7: WARNING: toctree contains reference to nonexisting document 'examples/usecases/inverse_kinematics' /builddir/build/BUILD/pyswarms-1.3.0/docs/usecases.rst:7: WARNING: toctree contains reference to nonexisting document 'examples/usecases/feature_subset_selection' /builddir/build/BUILD/pyswarms-1.3.0/docs/usecases.rst:7: WARNING: toctree contains reference to nonexisting document 'examples/usecases/electric_circuit_problem' done checking consistency... done preparing documents... done writing output... [ 3%] api/_pyswarms.backend writing output... [ 7%] api/_pyswarms.base.classes writing output... [ 10%] api/_pyswarms.optimizers writing output... [ 14%] api/_pyswarms.utils writing output... [ 17%] api/pyswarms.backend writing output... [ 21%] api/pyswarms.base writing output... [ 25%] api/pyswarms.discrete writing output... [ 28%] api/pyswarms.handlers writing output... [ 32%] api/pyswarms.single writing output... [ 35%] api/pyswarms.swarms writing output... [ 39%] api/pyswarms.topology writing output... [ 42%] api/pyswarms.utils.decorators writing output... [ 46%] api/pyswarms.utils.functions writing output... [ 50%] api/pyswarms.utils.plotters writing output... [ 53%] api/pyswarms.utils.reporter writing output... [ 57%] api/pyswarms.utils.search writing output... [ 60%] authors writing output... [ 64%] contributing writing output... [ 67%] dev.api writing output... [ 71%] dev.loop writing output... [ 75%] dev.optimizer writing output... [ 78%] features writing output... [ 82%] history writing output... [ 85%] index writing output... [ 89%] installation writing output... [ 92%] intro writing output... [ 96%] tutorials writing output... [100%] usecases generating indices... genindex py-modindex done highlighting module code... [ 4%] _abc highlighting module code... [ 8%] pyswarms.backend.generators highlighting module code... [ 12%] pyswarms.backend.handlers highlighting module code... [ 16%] pyswarms.backend.operators highlighting module code... [ 20%] pyswarms.backend.swarms highlighting module code... [ 24%] pyswarms.backend.topology.base highlighting module code... [ 28%] pyswarms.backend.topology.pyramid highlighting module code... [ 32%] pyswarms.backend.topology.random highlighting module code... [ 36%] pyswarms.backend.topology.ring highlighting module code... [ 40%] pyswarms.backend.topology.star highlighting module code... [ 44%] pyswarms.backend.topology.von_neumann highlighting module code... [ 48%] pyswarms.base.base_discrete highlighting module code... [ 52%] pyswarms.base.base_single highlighting module code... [ 56%] pyswarms.discrete.binary highlighting module code... [ 60%] pyswarms.single.general_optimizer highlighting module code... [ 64%] pyswarms.single.global_best highlighting module code... [ 68%] pyswarms.single.local_best highlighting module code... [ 72%] pyswarms.utils.decorators.decorators highlighting module code... [ 76%] pyswarms.utils.functions.single_obj highlighting module code... [ 80%] pyswarms.utils.plotters.formatters highlighting module code... [ 84%] pyswarms.utils.plotters.plotters highlighting module code... [ 88%] pyswarms.utils.reporter.reporter highlighting module code... [ 92%] pyswarms.utils.search.base_search highlighting module code... [ 96%] pyswarms.utils.search.grid_search highlighting module code... [100%] pyswarms.utils.search.random_search writing additional pages... search done copying images... [ 25%] assets/pyswarms_api.png copying images... [ 50%] assets/optimization_loop.png copying images... [ 75%] assets/inheritance.png copying images... [100%] pyswarms-header.png copying static files... done copying extra files... done dumping search index in English (code: en)... done dumping object inventory... done build succeeded, 68 warnings. The HTML pages are in html. + rm -rf html/.doctrees html/.buildinfo + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.azXCSY + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch ++ dirname /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd pyswarms-1.3.0 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + /usr/bin/python3 setup.py install -O1 --skip-build --root /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch --prefix /usr running install /usr/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running install_lib creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11 creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/discrete copying build/lib/pyswarms/discrete/binary.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/discrete copying build/lib/pyswarms/discrete/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/discrete creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend copying build/lib/pyswarms/backend/handlers.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/topology/von_neumann.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/topology/random.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/topology/ring.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/topology/star.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/topology/base.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/topology/pyramid.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/topology/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology copying build/lib/pyswarms/backend/operators.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend copying build/lib/pyswarms/backend/swarms.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend copying build/lib/pyswarms/backend/generators.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend copying build/lib/pyswarms/backend/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/base copying build/lib/pyswarms/base/base_discrete.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/base copying build/lib/pyswarms/base/base_single.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/base copying build/lib/pyswarms/base/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/base creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/plotters copying build/lib/pyswarms/utils/plotters/plotters.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/plotters copying build/lib/pyswarms/utils/plotters/formatters.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/plotters copying build/lib/pyswarms/utils/plotters/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/plotters creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/reporter copying build/lib/pyswarms/utils/reporter/reporter.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/reporter copying build/lib/pyswarms/utils/reporter/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/reporter creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/functions copying build/lib/pyswarms/utils/functions/single_obj.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/functions copying build/lib/pyswarms/utils/functions/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/functions creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/decorators copying build/lib/pyswarms/utils/decorators/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/decorators copying build/lib/pyswarms/utils/decorators/decorators.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/decorators creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search copying build/lib/pyswarms/utils/search/random_search.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search copying build/lib/pyswarms/utils/search/grid_search.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search copying build/lib/pyswarms/utils/search/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search copying build/lib/pyswarms/utils/search/base_search.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search copying build/lib/pyswarms/utils/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single copying build/lib/pyswarms/single/local_best.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single copying build/lib/pyswarms/single/global_best.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single copying build/lib/pyswarms/single/general_optimizer.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single copying build/lib/pyswarms/single/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single copying build/lib/pyswarms/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend copying build/lib/tests/backend/test_generators.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/test_von_neumann.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/test_ring.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/test_star.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/test_pyramid.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/test_random.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/abc_test_topology.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/conftest.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/topology/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology copying build/lib/tests/backend/test_handlers.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend copying build/lib/tests/backend/conftest.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend copying build/lib/tests/backend/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend copying build/lib/tests/backend/test_operators.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/plotters copying build/lib/tests/utils/plotters/test_plotters.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/plotters copying build/lib/tests/utils/plotters/conftest.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/plotters copying build/lib/tests/utils/plotters/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/plotters creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions copying build/lib/tests/utils/functions/test_singleobj_returndims.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions copying build/lib/tests/utils/functions/test_singleobj_bounds.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions copying build/lib/tests/utils/functions/conftest.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions copying build/lib/tests/utils/functions/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions copying build/lib/tests/utils/functions/test_singleobj_dims.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions copying build/lib/tests/utils/functions/test_singleobj_return.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/decorators copying build/lib/tests/utils/decorators/test_decorators.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/decorators copying build/lib/tests/utils/decorators/conftest.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/decorators copying build/lib/tests/utils/decorators/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/decorators creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search copying build/lib/tests/utils/search/test_randomsearch.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search copying build/lib/tests/utils/search/test_gridsearch.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search copying build/lib/tests/utils/search/conftest.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search copying build/lib/tests/utils/search/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search copying build/lib/tests/utils/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils creating /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/abc_test_discrete_optimizer.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/test_local_best.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/test_binary.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/test_verbose.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/test_tolerance.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/test_global_best.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/__init__.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/abc_test_optimizer.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers copying build/lib/tests/optimizers/test_general_optimizer.py -> /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/discrete/binary.py to binary.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/discrete/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/handlers.py to handlers.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology/von_neumann.py to von_neumann.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology/random.py to random.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology/ring.py to ring.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology/star.py to star.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology/base.py to base.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology/pyramid.py to pyramid.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/topology/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/operators.py to operators.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/swarms.py to swarms.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/generators.py to generators.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/backend/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/base/base_discrete.py to base_discrete.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/base/base_single.py to base_single.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/base/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/plotters/plotters.py to plotters.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/plotters/formatters.py to formatters.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/plotters/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/reporter/reporter.py to reporter.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/reporter/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/functions/single_obj.py to single_obj.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/functions/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/decorators/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/decorators/decorators.py to decorators.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search/random_search.py to random_search.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search/grid_search.py to grid_search.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/search/base_search.py to base_search.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/utils/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single/local_best.py to local_best.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single/global_best.py to global_best.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single/general_optimizer.py to general_optimizer.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/single/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/test_generators.py to test_generators.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/test_von_neumann.py to test_von_neumann.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/test_ring.py to test_ring.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/test_star.py to test_star.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/test_pyramid.py to test_pyramid.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/test_random.py to test_random.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/abc_test_topology.py to abc_test_topology.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/conftest.py to conftest.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/topology/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/test_handlers.py to test_handlers.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/conftest.py to conftest.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/backend/test_operators.py to test_operators.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/plotters/test_plotters.py to test_plotters.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/plotters/conftest.py to conftest.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/plotters/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions/test_singleobj_returndims.py to test_singleobj_returndims.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions/test_singleobj_bounds.py to test_singleobj_bounds.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions/conftest.py to conftest.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions/test_singleobj_dims.py to test_singleobj_dims.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/functions/test_singleobj_return.py to test_singleobj_return.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/decorators/test_decorators.py to test_decorators.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/decorators/conftest.py to conftest.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/decorators/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search/test_randomsearch.py to test_randomsearch.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search/test_gridsearch.py to test_gridsearch.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search/conftest.py to conftest.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/search/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/utils/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/abc_test_discrete_optimizer.py to abc_test_discrete_optimizer.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/test_local_best.py to test_local_best.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/test_binary.py to test_binary.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/test_verbose.py to test_verbose.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/test_tolerance.py to test_tolerance.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/test_global_best.py to test_global_best.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/__init__.py to __init__.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/abc_test_optimizer.py to abc_test_optimizer.cpython-311.pyc byte-compiling /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/tests/optimizers/test_general_optimizer.py to test_general_optimizer.cpython-311.pyc writing byte-compilation script '/tmp/tmp_wycg57l.py' /usr/bin/python3 /tmp/tmp_wycg57l.py removing /tmp/tmp_wycg57l.py running install_egg_info running egg_info writing pyswarms.egg-info/PKG-INFO writing dependency_links to pyswarms.egg-info/dependency_links.txt writing requirements to pyswarms.egg-info/requires.txt writing top-level names to pyswarms.egg-info/top_level.txt reading manifest file 'pyswarms.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' warning: no files found matching '*.jpg' under directory 'docs' adding license file 'LICENSE' adding license file 'AUTHORS.rst' writing manifest file 'pyswarms.egg-info/SOURCES.txt' Copying pyswarms.egg-info to /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages/pyswarms-1.3.0-py3.11.egg-info running install_scripts + rm -rfv /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/bin/__pycache__ + rm -rf /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch//usr/lib/python3.11/site-packages/tests + /usr/bin/find-debuginfo -j8 --strict-build-id -m -i --build-id-seed 1.3.0-13.fc38 --unique-debug-suffix -1.3.0-13.fc38.noarch --unique-debug-src-base python-pyswarms-1.3.0-13.fc38.noarch --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 -S debugsourcefiles.list /builddir/build/BUILD/pyswarms-1.3.0 find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/brp-remove-la-files + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j8 Bytecompiling .py files below /builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11 using python3.11 + /usr/lib/rpm/redhat/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.BaC5G1 + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd pyswarms-1.3.0 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + PATH=/builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib64/python3.11/site-packages:/builddir/build/BUILDROOT/python-pyswarms-1.3.0-13.fc38.noarch/usr/lib/python3.11/site-packages + PYTHONDONTWRITEBYTECODE=1 + PYTEST_XDIST_AUTO_NUM_WORKERS=8 + /usr/bin/pytest ============================= test session starts ============================== platform linux -- Python 3.11.2, pytest-7.2.2, pluggy-1.0.0 rootdir: /builddir/build/BUILD/pyswarms-1.3.0 collected 468 items tests/backend/test_generators.py ........................... [ 5%] tests/backend/test_handlers.py .................. [ 9%] tests/backend/test_operators.py ................................ [ 16%] tests/backend/topology/test_pyramid.py ............FF....FF [ 20%] tests/backend/topology/test_random.py ............FFFFFF............FFFF [ 27%] FFFFFFFF...... [ 30%] tests/backend/topology/test_ring.py .................................... [ 38%] ........................ [ 43%] tests/backend/topology/test_star.py ................... [ 47%] tests/backend/topology/test_von_neumann.py ............................. [ 54%] .. [ 54%] tests/optimizers/test_binary.py ......s.ssss. [ 57%] tests/optimizers/test_general_optimizer.py EEEEEEEEEE...............EE.. [ 63%] .FF...FF...sssss...............FF...FF... [ 72%] tests/optimizers/test_global_best.py ......s...... [ 75%] tests/optimizers/test_local_best.py ......s...... [ 77%] tests/optimizers/test_tolerance.py ............ [ 80%] tests/optimizers/test_verbose.py ...... [ 81%] tests/utils/decorators/test_decorators.py ... [ 82%] tests/utils/functions/test_singleobj_bounds.py ................. [ 85%] tests/utils/functions/test_singleobj_dims.py ............. [ 88%] tests/utils/functions/test_singleobj_return.py ................. [ 92%] tests/utils/functions/test_singleobj_returndims.py ................ [ 95%] tests/utils/plotters/test_plotters.py .......... [ 97%] tests/utils/search/test_gridsearch.py ... [ 98%] tests/utils/search/test_randomsearch.py ....... [100%] ==================================== ERRORS ==================================== _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history0-cost_history-expected_shape0] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.99029359, 0.76531587], [0.6685371 , 0.85310907], [0.36142089, 0.14341208], ...6, 1.17473693, 0.15119209, 0.54211531, 0.53914621, 0.4226627 , 1.00655433, 0.39733392, 1.45670983, 0.97363041])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:17,526 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history0-mean_pbest_history-expected_shape1] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.30624789, 0.05165086], [0.75416436, 0.65598184], [0.31031865, 0.6876818 ], ...8, 0.99907606, 0.56920392, 0.29751352, 0.32525977, 0.52840273, 0.23007385, 0.69895664, 0.04305751, 0.01352623])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:18,002 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history0-mean_neighbor_history-expected_shape2] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[4.24790858e-02, 4.79967629e-01], [6.17653642e-01, 5.40084442e-01], [2.20660480e-0... , 0.67318723, 0.1880149 , 0.15944628, 1.04534534, 0.55525344, 0.14690584, 0.86033917, 0.59613247, 1.33025593])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:18,473 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history0-pos_history-expected_shape3] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.07523083, 0.60700229], [0.25983392, 0.71715848], [0.02444011, 0.7700192 ], ...6, 0.58182995, 0.59352688, 1.93424925, 0.15346265, 0.32044927, 0.70388935, 0.13855282, 0.0224557 , 0.40665915])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:18,822 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history0-velocity_history-expected_shape4] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.5862148 , 0.64092563], [0.59509132, 0.60413641], [0.50611012, 0.62086073], ...6, 0.71911448, 0.6416155 , 0.4461474 , 0.99603916, 0.58006919, 0.2622653 , 1.58921563, 0.7308505 , 0.09804621])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:19,158 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history1-cost_history-expected_shape0] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.51490215, 0.45462026], [0.68215497, 0.55949659], [0.9998064 , 0.82355505], ...1, 0.77837183, 1.67785576, 0.41286531, 0.27471781, 1.16749578, 0.47184871, 0.09906152, 0.73977598, 0.79449084])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:19,503 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history1-mean_pbest_history-expected_shape1] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.83113719, 0.64789419], [0.22120909, 0.75033138], [0.35016558, 0.05238123], ...1, 0.61193064, 0.12535972, 0.42919719, 0.17788249, 0.21359485, 0.88748287, 0.51622943, 0.13703622, 0.44053877])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:19,918 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history1-mean_neighbor_history-expected_shape2] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.85910237, 0.58662652], [0.01104575, 0.04268973], [0.06732968, 0.89123088], ...6, 0.00194442, 0.79882577, 1.32235343, 0.54698679, 1.10634628, 1.37086129, 1.15999892, 0.10509014, 0.45117664])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:20,329 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history1-pos_history-expected_shape3] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.07252271, 0.30393862], [0.27858497, 0.74086601], [0.20995506, 0.55546253], ...3, 0.62649203, 0.35261975, 1.38630583, 0.17958145, 0.12283552, 0.1223294 , 1.77171099, 0.08239325, 0.78298852])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:20,718 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_train_history[optimizer_history1-velocity_history-expected_shape4] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_history(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.81388614, 0.4370778 ], [0.68699085, 0.51364953], [0.33298476, 0.11310416], ...5, 0.73579227, 0.1236714 , 0.39075662, 0.91690412, 1.57972041, 0.55847547, 0.83964489, 1.60274274, 0.88257125])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:25:21,109 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_reset_default_values[optimizer_reset0] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_reset(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:62: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.67228853, 0.23440704], [0.94642137, 0.45839998], [0.52038258, 0.63395598], ...2, 1.10584396, 0.67269821, 0.00778578, 1.17068339, 0.42129283, 0.84218534, 0.19432647, 0.39260636, 0.71792264])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:27:54,073 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 _ ERROR at setup of TestGeneralOptimizer.test_reset_default_values[optimizer_reset1] _ self = request = > options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} @pytest.fixture(params=topologies) def optimizer_reset(self, request, options): opt = GeneralOptimizerPSO( n_particles=10, dimensions=2, options=options, topology=request.param, ) > opt.optimize(sphere, 1000) tests/optimizers/test_general_optimizer.py:62: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[0.54757069, 0.0348945 ], [0.55560249, 0.29985545], [0.30600631, 0.02131675], ...9, 0.39860742, 0.09409426, 1.65684944, 1.58365622, 0.18122944, 0.28831803, 0.13856337, 0.43110159, 0.01326735])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ---------------------------- Captured stderr setup ----------------------------- 2023-05-05 09:27:54,490 - pyswarms.single.general_optimizer - INFO - Optimize for 1000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/1000 pyswarms.single.general_optimizer: 0%| |0/1000 =================================== FAILURES =================================== _________________ TestPyramidTopology.test_neighbor_idx[True] __________________ self = topology = , options = {} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = True @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) kwargs = {} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError _________________ TestPyramidTopology.test_neighbor_idx[False] _________________ self = topology = , options = {} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = False @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) kwargs = {} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError __________ TestPyramidTopology.test_compute_gbest_return_values[True] __________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) topology = , options = {} static = True @pytest.mark.parametrize("static", [True, False]) def test_compute_gbest_return_values( self, swarm, topology, options, static ): """Test if compute_gbest() gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_pyramid.py:34: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) kwargs = {} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError _________ TestPyramidTopology.test_compute_gbest_return_values[False] __________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) topology = , options = {} static = False @pytest.mark.parametrize("static", [True, False]) def test_compute_gbest_return_values( self, swarm, topology, options, static ): """Test if compute_gbest() gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_pyramid.py:34: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) kwargs = {} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError _________________ TestRandomTopology.test_neighbor_idx[1-True] _________________ self = topology = , options = {'k': 1} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = True @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 1, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________________ TestRandomTopology.test_neighbor_idx[1-False] _________________ self = topology = , options = {'k': 1} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = False @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 1, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError _________________ TestRandomTopology.test_neighbor_idx[2-True] _________________ self = topology = , options = {'k': 2} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = True @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 2, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________________ TestRandomTopology.test_neighbor_idx[2-False] _________________ self = topology = , options = {'k': 2} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = False @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 2, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError _________________ TestRandomTopology.test_neighbor_idx[3-True] _________________ self = topology = , options = {'k': 3} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = True @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 3, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________________ TestRandomTopology.test_neighbor_idx[3-False] _________________ self = topology = , options = {'k': 3} swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) static = False @pytest.mark.parametrize("static", [True, False]) def test_neighbor_idx(self, topology, options, swarm, static): """Test if the neighbor_idx attribute is assigned""" topo = topology(static=static) > topo.compute_gbest(swarm, **options) tests/backend/topology/abc_test_topology.py:60: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 3, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[1-1-True] _________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 1}, topology = k = 1, static = True @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 1, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[1-1-False] ________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 1}, topology = k = 1, static = False @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 1, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[1-2-True] _________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 1}, topology = k = 2, static = True @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 1, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[1-2-False] ________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 1}, topology = k = 2, static = False @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 1, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[2-1-True] _________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 2}, topology = k = 1, static = True @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 2, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[2-1-False] ________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 2}, topology = k = 1, static = False @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 2, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[2-2-True] _________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 2}, topology = k = 2, static = True @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 2, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[2-2-False] ________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 2}, topology = k = 2, static = False @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 2, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[3-1-True] _________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 3}, topology = k = 1, static = True @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 3, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[3-1-False] ________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 3}, topology = k = 1, static = False @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 3, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[3-2-True] _________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 3}, topology = k = 2, static = True @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 3, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ________ TestRandomTopology.test_compute_gbest_return_values[3-2-False] ________ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) options = {'k': 3}, topology = k = 2, static = False @pytest.mark.parametrize("static", [True, False]) @pytest.mark.parametrize("k", [1, 2]) def test_compute_gbest_return_values( self, swarm, options, topology, k, static ): """Test if update_gbest_neighborhood gives the expected return values""" topo = topology(static=static) expected_cost = 1.0002528364353296 expected_pos = np.array( [9.90438476e-01, 2.50379538e-03, 1.87405987e-05] ) expected_pos_2 = np.array( [9.98033031e-01, 4.97392619e-03, 3.07726256e-03] ) > pos, cost = topo.compute_gbest(swarm, **options) tests/backend/topology/test_random.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.09583869e+00, 5.87433429e-04, 6.49113772e-03], [ 1.00559609e+00, 3.96477697e-02, ...7911 , 19.6046078 , 14.05300016, 3.72597614, 1.01169386, 16.51846203, 32.72262829, 3.80274901, 1.05237138])) k = 3, kwargs = {} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ______________ TestGeneralOptimizer.test_ftol_effect[optimizer0] _______________ self = optimizer = def test_ftol_effect(self, optimizer): """Test if setting the ftol breaks the optimization process""" # Set optimizer tolerance optimizer.ftol = 1e-1 > optimizer.optimize(sphere, 2000) tests/optimizers/test_general_optimizer.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 9.39117184, 8.41457401], [ 3.18236174, 2.00502092], [ 7.22196331, 2.58623619]...7169, 26.04933935, 121.93237678, 43.01115554, 27.34553067, 34.43390411, 46.75167026, 84.49426476])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:28:26,834 - pyswarms.single.general_optimizer - INFO - Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/2000 pyswarms.single.general_optimizer: 0%| |0/2000 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} ______________ TestGeneralOptimizer.test_ftol_effect[optimizer1] _______________ self = optimizer = def test_ftol_effect(self, optimizer): """Test if setting the ftol breaks the optimization process""" # Set optimizer tolerance optimizer.ftol = 1e-1 > optimizer.optimize(sphere, 2000) tests/optimizers/test_general_optimizer.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 1.13929941, 5.30589087], [ 6.99829511, 4.99919672], [ 8.56240425, -1.40566438]...5895, 98.50043574, 80.71325327, 129.84633795, 76.09380121, 80.11840759, 42.15125109, 31.46722553])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:28:27,157 - pyswarms.single.general_optimizer - INFO - Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/2000 pyswarms.single.general_optimizer: 0%| |0/2000 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} __________ TestGeneralOptimizer.test_parallel_evaluation[optimizer0] ___________ self = obj_without_args = optimizer = def test_parallel_evaluation(self, obj_without_args, optimizer): """Test if parallelization breaks the optimization process""" import multiprocessing > optimizer.optimize( obj_without_args, 2000, n_processes=multiprocessing.cpu_count() ) tests/optimizers/test_general_optimizer.py:77: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 4.07768431, 4.22517833], [-9.60809439, 9.74183118], [-7.40271809, -6.25135212]...48e+04, 8.89355153e+04, 8.28796662e+05, 1.34759167e+05, 2.96604873e+05, 4.66306378e+05, 2.85462052e+02])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:28:28,016 - pyswarms.single.general_optimizer - INFO - Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/2000 pyswarms.single.general_optimizer: 0%| |0/2000 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} __________ TestGeneralOptimizer.test_parallel_evaluation[optimizer1] ___________ self = obj_without_args = optimizer = def test_parallel_evaluation(self, obj_without_args, optimizer): """Test if parallelization breaks the optimization process""" import multiprocessing > optimizer.optimize( obj_without_args, 2000, n_processes=multiprocessing.cpu_count() ) tests/optimizers/test_general_optimizer.py:77: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[-4.88757722, 6.68172228], [-1.72184274, 3.87419572], [ 9.5457183 , 3.93376239]...98e+05, 3.69140480e+05, 5.91885488e+03, 2.62591498e+03, 9.00149012e+03, 2.03526321e+04, 5.44202006e+04])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:28:31,453 - pyswarms.single.general_optimizer - INFO - Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/2000 pyswarms.single.general_optimizer: 0%| |0/2000 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} __________ TestGeneralOptimizer.test_general_correct_pos[optimizer0] ___________ self = options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} optimizer = def test_general_correct_pos(self, options, optimizer): """ Test to check general optimiser returns the correct position corresponding to the best cost """ > cost, pos = optimizer.optimize(sphere, iters=5) tests/optimizers/test_general_optimizer.py:110: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[-7.1248994 , -2.11622523], [ 3.3243314 , -1.48069574], [ 9.0088584 , 1.86083229]...63916, 84.62222649, 0.23524116, 22.28278838, 43.63044772, 44.91056116, 38.22385227, 67.12752471, 96.81426336])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:35:17,363 - pyswarms.single.general_optimizer - INFO - Optimize for 5 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/5 pyswarms.single.general_optimizer: 0%| |0/5 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 5 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} __________ TestGeneralOptimizer.test_general_correct_pos[optimizer1] ___________ self = options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} optimizer = def test_general_correct_pos(self, options, optimizer): """ Test to check general optimiser returns the correct position corresponding to the best cost """ > cost, pos = optimizer.optimize(sphere, iters=5) tests/optimizers/test_general_optimizer.py:110: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[-9.5525505 , 8.12611623], [-3.97951458, 2.35925133], [ 4.72859165, 8.34408622]...5394, 71.57341199, 37.34249238, 63.09024736, 123.39650422, 71.58071449, 70.66179799, 96.71670285])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:35:17,718 - pyswarms.single.general_optimizer - INFO - Optimize for 5 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/5 pyswarms.single.general_optimizer: 0%| |0/5 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 5 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} ____________ TestGeneralOptimizer.test_ftol_iter_effect[optimizer0] ____________ self = optimizer = def test_ftol_iter_effect(self, optimizer): """Test if setting the ftol breaks the optimization process after the set number of iterations""" # Set optimizer tolerance optimizer.ftol = 1e-1 optimizer.ftol_iter = 5 > optimizer.optimize(sphere, 2000) tests/optimizers/test_general_optimizer.py:123: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 1.24947433, -5.91574812], [-0.356437 , -4.75970055], [-0.06733537, 7.50780009]...9627, 46.65515517, 77.10656036, 9.24944034, 88.46069656, 138.94994324, 14.61918149, 48.35628255])) kwargs = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} pyramid = def compute_gbest(self, swarm, **kwargs): """Update the global best using a pyramid neighborhood approach This topology uses the :code:`Delaunay` class from :code:`scipy`. To prevent precision errors in the Delaunay class, custom :code:`qhull_options` were added. Namely, :code:`QJ0.001 Qbb Qc Qx`. The meaning of those options is explained in [qhull]. This method is used to triangulate N-dimensional space into simplices. The vertices of the simplicies consist of swarm particles. This method is adapted from the work of Lane et al.[SIS2008] [SIS2008] J. Lane, A. Engelbrecht and J. Gain, "Particle swarm optimization with spatially meaningful neighbours," 2008 IEEE Swarm Intelligence Symposium, St. Louis, MO, 2008, pp. 1-8. doi: 10.1109/SIS.2008.4668281 [qhull] http://www.qhull.org/html/qh-optq.htm Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # If there are less than (swarm.dimensions + 1) particles they are all connected if swarm.n_particles < swarm.dimensions + 1: self.neighbor_idx = np.tile( np.arange(swarm.n_particles), (swarm.n_particles, 1) ) best_pos = swarm.pbest_pos[np.argmin(swarm.pbest_cost)] best_cost = np.min(swarm.pbest_cost) else: # Check if the topology is static or dynamic and assign neighbors if ( self.static and self.neighbor_idx is None ) or not self.static: pyramid = Delaunay( swarm.position, qhull_options="QJ0.001 Qbb Qc Qx" ) indices, index_pointer = pyramid.vertex_neighbor_vertices # Insert all the neighbors for each particle in the idx array > self.neighbor_idx = np.array( [ index_pointer[indices[i] : indices[i + 1]] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/pyramid.py:81: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:35:18,504 - pyswarms.single.general_optimizer - INFO - Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/2000 pyswarms.single.general_optimizer: 0%| |0/2000 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} ____________ TestGeneralOptimizer.test_ftol_iter_effect[optimizer1] ____________ self = optimizer = def test_ftol_iter_effect(self, optimizer): """Test if setting the ftol breaks the optimization process after the set number of iterations""" # Set optimizer tolerance optimizer.ftol = 1e-1 optimizer.ftol_iter = 5 > optimizer.optimize(sphere, 2000) tests/optimizers/test_general_optimizer.py:123: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyswarms/single/general_optimizer.py:252: in optimize self.swarm.best_pos, self.swarm.best_cost = self.top.compute_gbest( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = swarm = Swarm(position=array([[ 9.50072285, -6.0456065 ], [-6.70535112, -0.86183289], [ 8.40665753, -1.29908235]...0574, 117.62446344, 79.53355526, 86.82243386, 79.37442788, 6.11656931, 66.67489885, 107.27489302])) k = 2, kwargs = {'c1': 0.3, 'c2': 0.7, 'p': 2, 'r': 1, ...} def compute_gbest(self, swarm, k, **kwargs): """Update the global best using a random neighborhood approach This uses random class from :code:`numpy` to give every particle k randomly distributed, non-equal neighbors. The resulting topology is a connected graph. The algorithm to obtain the neighbors was adapted from [TSWJ2013]. [TSWJ2013] Qingjian Ni and Jianming Deng, “A New Logistic Dynamic Particle Swarm Optimization Algorithm Based on Random Topology,” The Scientific World Journal, vol. 2013, Article ID 409167, 8 pages, 2013. https://doi.org/10.1155/2013/409167. Parameters ---------- swarm : pyswarms.backend.swarms.Swarm a Swarm instance k : int number of neighbors to be considered. Must be a positive integer less than :code:`n_particles-1` Returns ------- numpy.ndarray Best position of shape :code:`(n_dimensions, )` float Best cost """ try: # Check if the topology is static or dynamic and assign neighbors if (self.static and self.neighbor_idx is None) or not self.static: adj_matrix = self.__compute_neighbors(swarm, k) > self.neighbor_idx = np.array( [ adj_matrix[i].nonzero()[0] for i in range(swarm.n_particles) ] ) E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part. pyswarms/backend/topology/random.py:68: ValueError ----------------------------- Captured stderr call ----------------------------- 2023-05-05 09:35:18,762 - pyswarms.single.general_optimizer - INFO - Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} pyswarms.single.general_optimizer: 0%| |0/2000 pyswarms.single.general_optimizer: 0%| |0/2000 ------------------------------ Captured log call ------------------------------- INFO pyswarms.single.general_optimizer:reporter.py:139 Optimize for 2000 iters with {'c1': 0.3, 'c2': 0.7, 'w': 0.9, 'k': 2, 'p': 2, 'r': 1} =============================== warnings summary =============================== tests/utils/plotters/test_plotters.py::test_plot_surface_return_type tests/utils/plotters/test_plotters.py::test_animate_hidden_function_type /usr/lib64/python3.11/site-packages/matplotlib/animation.py:880: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. `anim`, that exists until you output the Animation using `plt.show()` or `anim.save()`. warnings.warn( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED tests/backend/topology/test_pyramid.py::TestPyramidTopology::test_neighbor_idx[True] FAILED tests/backend/topology/test_pyramid.py::TestPyramidTopology::test_neighbor_idx[False] FAILED tests/backend/topology/test_pyramid.py::TestPyramidTopology::test_compute_gbest_return_values[True] FAILED tests/backend/topology/test_pyramid.py::TestPyramidTopology::test_compute_gbest_return_values[False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_neighbor_idx[1-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_neighbor_idx[1-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_neighbor_idx[2-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_neighbor_idx[2-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_neighbor_idx[3-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_neighbor_idx[3-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[1-1-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[1-1-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[1-2-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[1-2-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[2-1-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[2-1-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[2-2-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[2-2-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[3-1-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[3-1-False] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[3-2-True] FAILED tests/backend/topology/test_random.py::TestRandomTopology::test_compute_gbest_return_values[3-2-False] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_ftol_effect[optimizer0] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_ftol_effect[optimizer1] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_parallel_evaluation[optimizer0] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_parallel_evaluation[optimizer1] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_general_correct_pos[optimizer0] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_general_correct_pos[optimizer1] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_ftol_iter_effect[optimizer0] FAILED tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_ftol_iter_effect[optimizer1] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history0-cost_history-expected_shape0] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history0-mean_pbest_history-expected_shape1] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history0-mean_neighbor_history-expected_shape2] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history0-pos_history-expected_shape3] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history0-velocity_history-expected_shape4] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history1-cost_history-expected_shape0] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history1-mean_pbest_history-expected_shape1] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history1-mean_neighbor_history-expected_shape2] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history1-pos_history-expected_shape3] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_train_history[optimizer_history1-velocity_history-expected_shape4] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_reset_default_values[optimizer_reset0] ERROR tests/optimizers/test_general_optimizer.py::TestGeneralOptimizer::test_reset_default_values[optimizer_reset1] = 30 failed, 414 passed, 12 skipped, 2 warnings, 12 errors in 1485.73s (0:24:45) = RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.BaC5G1 (%check) Bad exit status from /var/tmp/rpm-tmp.BaC5G1 (%check) Child return code was: 1 EXCEPTION: [Error('Command failed: \n # bash --login -c /usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/python-pyswarms.spec\n', 1)] Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py", line 93, in trace result = func(*args, **kw) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/mockbuild/util.py", line 598, in do_with_status raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/python-pyswarms.spec