First example fail on colab
When trying to run the topfarm examples on my computer or on colab, it returns a bunch of warnings from openmdao and fail to instanciate the topfarm problem. Strangely there is no error message.
Run it on this colab notebook
---------------------------------------------------------------------------
RuntimeWarning Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/topfarm/_topfarm.py in setup(self)
209 self.driver.add_recorder(tmp_recorder)
--> 210 Problem.final_setup(self)
211 self.driver._rec_mgr._recorders.remove(tmp_recorder)
/usr/local/lib/python3.6/dist-packages/openmdao/core/problem.py in final_setup(self)
626
--> 627 self.driver._setup_driver(self)
628
/usr/local/lib/python3.6/dist-packages/openmdao/drivers/scipy_optimizer.py in _setup_driver(self, problem)
168 """
--> 169 super(ScipyOptimizeDriver, self)._setup_driver(problem)
170 opt = self.options['optimizer']
/usr/local/lib/python3.6/dist-packages/openmdao/core/driver.py in _setup_driver(self, problem)
336 "(objectives and constraints)." %
--> 337 (problem._mode, desvar_size, response_size), RuntimeWarning)
338
RuntimeWarning: Inefficient choice of derivative mode. You chose 'rev' for a problem with 8 design variables and 31 response variables (objectives and constraints).
During handling of the above exception, another exception occurred:
DeprecationWarning Traceback (most recent call last)
<ipython-input-3-5b1c00c6862d> in <module>()
15 SpacingConstraint(min_spacing)],
16 plot_comp=DummyCostPlotComp(desired),
---> 17 driver=EasyScipyOptimizeDriver()
18 )
/usr/local/lib/python3.6/dist-packages/topfarm/_topfarm.py in __init__(self, design_vars, cost_comp, driver, constraints, plot_comp, record_id, expected_cost, ext_vars)
160 plot_comp.n_wt = self.n_wt
161
--> 162 self.setup()
163
164 @property
/usr/local/lib/python3.6/dist-packages/topfarm/_topfarm.py in setup(self)
214 except Warning as w:
215 if str(w).startswith('Inefficient choice of derivative mode'):
--> 216 Problem.setup(self, check=True, mode='fwd')
217 else:
218 raise w
/usr/local/lib/python3.6/dist-packages/openmdao/core/problem.py in setup(self, vector_class, check, logger, mode, force_alloc_complex, distributed_vector_class, local_vector_class)
600 model_comm = self.driver._setup_comm(comm)
601
--> 602 model._setup(model_comm, 'full', mode, distributed_vector_class, local_vector_class)
603
604 # Cache all args for final setup.
/usr/local/lib/python3.6/dist-packages/openmdao/core/system.py in _setup(self, comm, setup_mode, mode, distributed_vector_class, local_vector_class)
690 self._setup_vec_names(mode, self._vec_names, self._vois)
691 self._setup_global_connections(recurse=recurse)
--> 692 self._setup_relevance(mode, self._relevant)
693 self._setup_vars(recurse=recurse)
694 self._setup_var_index_ranges(self._get_initial_var_indices(initial), recurse=recurse)
/usr/local/lib/python3.6/dist-packages/openmdao/core/system.py in _setup_relevance(self, mode, relevant)
1012 """
1013 if relevant is None: # should only occur at top level on full setup
-> 1014 self._relevant = relevant = self._init_relevance(mode)
1015 else:
1016 self._relevant = relevant
/usr/local/lib/python3.6/dist-packages/openmdao/core/group.py in _init_relevance(self, mode)
939 desvars = self.get_design_vars(recurse=True, get_sizes=False)
940 responses = self.get_responses(recurse=True, get_sizes=False)
--> 941 return get_relevant_vars(self._conn_global_abs_in2out, desvars, responses, mode)
942
943 def _setup_connections(self, recurse=True):
/usr/local/lib/python3.6/dist-packages/openmdao/core/group.py in get_relevant_vars(connections, desvars, responses, mode)
2011
2012 nodes = graph.nodes
-> 2013 grev = graph.reverse(copy=False)
2014
2015 for desvar in desvars:
/usr/local/lib/python3.6/dist-packages/networkx/classes/digraph.py in reverse(self, copy)
1184 in self.edges(data=True))
1185 return H
-> 1186 return nx.graphviews.ReverseView(self)
/usr/local/lib/python3.6/dist-packages/networkx/classes/graphviews.py in ReverseView(G)
126 import warnings
127 msg = 'ReverseView is deprecated. Use reverse_view instead'
--> 128 warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
129 return reverse_view(G)
130
DeprecationWarning: ReverseView is deprecated. Use reverse_view instead