Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use class name of a network if it is more informative #1002

Merged
merged 2 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Release History
0.4.5 (unreleased)
==================

- Improvement: subclasses of Network use their class name as a default label
- Bugfix: Removed duplicate response headers (fixes loading in Chrome)
- Bugfix: Fix for running with Tornado 6
- Bugfix: Handle recent changes to nengo.Process API (backwards-compatible)
Expand Down
6 changes: 4 additions & 2 deletions nengo_gui/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import logging
import os
import re
import socket
import threading
import time
Expand Down Expand Up @@ -380,8 +381,9 @@ def get_label(self, obj, default_labels=None):
assert label is not None
if '.' in label:
label = label.rsplit('.', 1)[1]
if label is None:
label = repr(obj)
if (re.match(r'networks\[\d+\]', label)
and obj.__class__.__name__ != 'Network'):
label = obj.__class__.__name__
return label

def get_uid(self, obj, default_labels=None):
Expand Down