diff --git a/CHANGES.rst b/CHANGES.rst index b3e0629b3..4f156f933 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,8 +24,10 @@ Release history **Fixed** - Support Sparse transforms in ``Simulator.get_nengo_params``. (`#149`_) +- Fixed bug in TensorGraph log message when logging was enabled. (`#151`_) .. _#149: https://github.com/nengo/nengo-dl/pull/149 +.. _#151: https://github.com/nengo/nengo-dl/pull/151 3.2.0 (April 2, 2020) --------------------- diff --git a/nengo_dl/tensor_graph.py b/nengo_dl/tensor_graph.py index 12a853299..25a0dde79 100644 --- a/nengo_dl/tensor_graph.py +++ b/nengo_dl/tensor_graph.py @@ -174,7 +174,7 @@ def __init__( logger.info("Optimized plan length: %d", len(self.plan)) logger.info( "Number of base arrays: (%s, %d), (%s, %d), (%s, %d)", - *tuple((k, len(x)) for k, x in self.base_arrays_init.items()), + *sum(((k, len(x)) for k, x in self.base_arrays_init.items()), ()), ) def build_inputs(self): diff --git a/nengo_dl/tests/test_simulator.py b/nengo_dl/tests/test_simulator.py index a96fecaf1..c84654e27 100644 --- a/nengo_dl/tests/test_simulator.py +++ b/nengo_dl/tests/test_simulator.py @@ -1822,3 +1822,16 @@ def test_sim_close(Simulator): with pytest.raises(SimulatorClosed, match="simulator is closed"): with sim: pass + + +def test_logging(Simulator, caplog): + with nengo.Network() as net: + inp = nengo.Node([0]) + ens = nengo.Ensemble(10, 1) + nengo.Connection(inp, ens) + nengo.Probe(ens) + + # run a simulation with logging to verify that there are no errors + with caplog.at_level(logging.NOTSET): + with Simulator(net) as sim: + sim.run_steps(10)