Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1979290 Details for
Bug 2226302
python-pyswarms: FTBFS in Fedora rawhide/f39
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh89 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
build.log
build.log (text/plain), 32.00 KB, created by
Fedora Release Engineering
on 2023-07-25 19:43:10 UTC
(
hide
)
Description:
build.log
Filename:
MIME Type:
Creator:
Fedora Release Engineering
Created:
2023-07-25 19:43:10 UTC
Size:
32.00 KB
patch
obsolete
> 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-07-21 13:13:10,046 - 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 = <tests.optimizers.test_general_optimizer.TestGeneralOptimizer object at 0x7fb217c4a9f0> >obj_without_args = <function rosenbrock at 0x7fb2183fc5e0> >optimizer = <pyswarms.single.general_optimizer.GeneralOptimizerPSO object at 0x7fb215073e30> > 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 = <pyswarms.backend.topology.random.Random object at 0x7fb217c339e0> >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, ...} >adj_matrix = array([[1, 1, 0, 1, 0, 1, 0, 1, 0, 0], > [1, 1, 0, 0, 0, 1, 0, 0, 1, 1], > [0, 0, 1, 0, 1, 0, 0, 1, 0, 1], > ..., > [1, 0, 1, 0, 0, 0, 1, 1, 1, 0], > [0, 1, 0, 0, 0, 0, 0, 1, 1, 1], > [0, 1, 1, 1, 0, 0, 0, 0, 1, 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-07-21 13:13:10,115 - 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 = <tests.optimizers.test_general_optimizer.TestGeneralOptimizer object at 0x7fb217c4bd10> >options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} >optimizer = <pyswarms.single.general_optimizer.GeneralOptimizerPSO object at 0x7fb214e92d80> > 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 = <pyswarms.backend.topology.pyramid.Pyramid object at 0x7fb217c33650> >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 = <scipy.spatial._qhull.Delaunay object at 0x7fb214f0e210> >indices = array([ 0, 3, 7, 10, 14, 22, 26, 32, 35, 39, 42], dtype=int32) >index_pointer = array([3, 6, 1, 3, 0, 4, 2, 4, 1, 9, 6, 0, 1, 4, 6, 3, 7, 1, 2, 9, 8, 5, > 4, 8, 7, 6, 3, 0, 4, 7, 5, 8, 4, 6, 5, 4, 9, 5, 6, 4, 2, 8], > dtype=int32) > 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-07-21 13:13:24,840 - 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 = <tests.optimizers.test_general_optimizer.TestGeneralOptimizer object at 0x7fb217c4be60> >options = {'c1': 0.3, 'c2': 0.7, 'k': 2, 'p': 2, ...} >optimizer = <pyswarms.single.general_optimizer.GeneralOptimizerPSO object at 0x7fb214f08710> > 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 = <pyswarms.backend.topology.random.Random object at 0x7fb217c339e0> >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, ...} >adj_matrix = array([[1, 1, 1, 0, 0, 0, 0, 0, 1, 1], > [1, 1, 0, 1, 0, 0, 0, 0, 0, 1], > [1, 0, 1, 0, 0, 0, 0, 0, 0, 1], > ..., > [0, 0, 0, 1, 0, 1, 1, 1, 0, 0], > [1, 0, 0, 0, 0, 1, 1, 0, 1, 0], > [1, 1, 1, 1, 0, 0, 0, 0, 0, 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-07-21 13:13:24,860 - 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 = <tests.optimizers.test_general_optimizer.TestGeneralOptimizer object at 0x7fb217c541d0> >optimizer = <pyswarms.single.general_optimizer.GeneralOptimizerPSO object at 0x7fb214efed50> > 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 = <pyswarms.backend.topology.pyramid.Pyramid object at 0x7fb217c33650> >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 = <scipy.spatial._qhull.Delaunay object at 0x7fb214f55070> >indices = array([ 0, 4, 9, 13, 19, 23, 28, 32, 38, 42, 46], dtype=int32) >index_pointer = array([3, 9, 1, 7, 3, 5, 8, 7, 0, 5, 4, 8, 7, 5, 4, 6, 9, 1, 0, 2, 5, 3, > 6, 2, 4, 8, 3, 1, 9, 7, 3, 4, 6, 9, 8, 2, 1, 0, 2, 7, 5, 1, 6, 7, > 3, 0], dtype=int32) > 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-07-21 13:13:24,903 - 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 = <tests.optimizers.test_general_optimizer.TestGeneralOptimizer object at 0x7fb217c54320> >optimizer = <pyswarms.single.general_optimizer.GeneralOptimizerPSO object at 0x7fb214eda150> > 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 = <pyswarms.backend.topology.random.Random object at 0x7fb217c339e0> >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, ...} >adj_matrix = array([[1, 0, 0, 1, 0, 0, 0, 1, 0, 0], > [0, 1, 0, 1, 0, 0, 1, 0, 0, 1], > [0, 0, 1, 0, 1, 1, 1, 1, 0, 0], > ..., > [1, 0, 1, 0, 0, 0, 0, 1, 0, 1], > [0, 0, 0, 1, 0, 1, 0, 0, 1, 0], > [0, 1, 0, 1, 1, 1, 0, 1, 0, 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-07-21 13:13:24,921 - 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/optimizers/test_binary.py: 1134 warnings >tests/optimizers/test_general_optimizer.py: 5979 warnings >tests/optimizers/test_global_best.py: 2215 warnings >tests/optimizers/test_local_best.py: 1236 warnings >tests/optimizers/test_tolerance.py: 293 warnings >tests/optimizers/test_verbose.py: 303 warnings >tests/utils/plotters/test_plotters.py: 303 warnings >tests/utils/search/test_gridsearch.py: 1782 warnings >tests/utils/search/test_randomsearch.py: 2200 warnings > /usr/lib/python3.12/site-packages/tqdm/std.py:465: DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC). > if rate and total else datetime.utcfromtimestamp(0)) >tests/optimizers/test_binary.py: 6 warnings >tests/optimizers/test_general_optimizer.py: 30 warnings >tests/optimizers/test_global_best.py: 6 warnings >tests/optimizers/test_local_best.py: 6 warnings >tests/utils/plotters/test_plotters.py: 6 warnings > /usr/lib64/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=714) is multi-threaded, use of fork() may lead to deadlocks in the child. > self.pid = os.fork() >tests/utils/plotters/test_plotters.py::test_plot_surface_return_type >tests/utils/plotters/test_plotters.py::test_parallel_mesh > /usr/lib64/python3.12/site-packages/matplotlib/animation.py:884: 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, 15501 warnings, 12 errors in 62.60s (0:01:02) = >error: Bad exit status from /var/tmp/rpm-tmp.1qrZ1a (%check) > Bad exit status from /var/tmp/rpm-tmp.1qrZ1a (%check) >RPM build errors: >Child return code was: 1 >EXCEPTION: [Error('Command failed: \n # /usr/bin/systemd-nspawn -q -M aec5107324004616b4925768b175330d -D /var/lib/mock/f39-build-44340745-5276606/root -a -u mockbuild --capability=cap_ipc_lock --bind=/tmp/mock-resolv.a66_jxjs:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/mapper/control --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\\033]0;<mock-chroot>\\007" --setenv=PS1=<mock-chroot> \\s-\\v\\$ --setenv=LANG=C.UTF-8 --resolv-conf=off 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 597, in do_with_status > raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) >mockbuild.exception.Error: Command failed: > # /usr/bin/systemd-nspawn -q -M aec5107324004616b4925768b175330d -D /var/lib/mock/f39-build-44340745-5276606/root -a -u mockbuild --capability=cap_ipc_lock --bind=/tmp/mock-resolv.a66_jxjs:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/mapper/control --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$ --setenv=LANG=C.UTF-8 --resolv-conf=off bash --login -c /usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/python-pyswarms.spec >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2226302
: 1979290 |
1979291
|
1979292