-
Notifications
You must be signed in to change notification settings - Fork 22
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
Drop support for Python 3.5 #184
Conversation
nengo_dl/__init__.py
Outdated
@@ -20,7 +20,7 @@ | |||
|
|||
There are two options for getting NengoDL working: | |||
|
|||
- Upgrade to Python >= 3.5 | |||
- Upgrade to Python >= 3.6 | |||
|
|||
- Install an older version of NengoDL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this "older version of NengoDL" to 3.4.0, since that's the latest to support Python 3.5 (if they're using earlier than 3.5, they'll have to figure things out themselves).
docs/examples/keras-to-snn.ipynb
Outdated
@@ -282,7 +282,7 @@ | |||
" plt.ylabel(\"Firing rates (Hz)\")\n", | |||
" plt.xlabel(\"Timestep\")\n", | |||
" plt.title(\n", | |||
" \"Neural activities (conv0 mean=%dHz max=%dHz)\" % (rates.mean(), rates.max())\n", | |||
" f\"Neural activities (conv0 mean={rates.mean()}Hz max={rates.max()}Hz)\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have spaces before units (Hz). Also, we were formatting these as integers before; I might recommend one decimal place.
@@ -835,7 +838,9 @@ def test_profile(Simulator, mode, tmp_path): | |||
with Simulator(net) as sim: | |||
# note: TensorFlow bug if using profile_batch=1, see | |||
# https://github.com/tensorflow/tensorflow/issues/37543 | |||
callback = callbacks.TensorBoard(log_dir=tmp_path / "profile", profile_batch=2) | |||
callback = callbacks.TensorBoard( | |||
log_dir=str(tmp_path / "profile"), profile_batch=2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need an explicit str
call here, but not earlier in this file when we create a tf.keras.callbacks.TensorBoard
? (callbacks.TensorBoard
uses the same constructor, so I'd think they'd be the same.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'm not sure. Generally I started by just passing in a Path wherever I could, and only converted it to a string if that failed. But I don't know why this one would have failed and the other didn't, maybe I just missed this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried removing the str
and it fails. No idea why it fails here and not in the other place, but either way it's all on the TensorFlow side of things so all we can do is cast the paths to strings where required.
@@ -5,7 +5,6 @@ | |||
import contextlib | |||
import logging | |||
import warnings | |||
from collections import OrderedDict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why pylint
didn't detect these unused imports 🤷
I've pushed the same fix here that I did in the Nengo PR, which is that we can't use f-strings in the code in If this looks good to you @drasmuss, I'll squash and merge. |
We could probably just drop that whole version warning as well. |
Sure, sounds good. We still need to not use f-strings in |
Maybe add a comment in Alternatively, I wonder if there's a way to monkeypatch out the python 3.6 features and try to parse |
Another thing we could do is clean up nengo/nengo-bones#39 which puts the version in |
Looks like we might be able to use |
Where would we put that I do like the idea of moving the version into |
Probably |
Ahh, got it, I misunderstood. I thought you meant we would use f-strings in |
Pushed a minor update to the test, fixups LGTM! |
I added a fix for some warnings that we weren't importing |
5f92079 - Fix codecov missing files with same names 01104fd - Extra f-string replacements 2f83812 - Drop support for Python 3.5
- Switch to using pathlib - Stop using OrderedDict - Switch to using f-strings
And switch to some of the nice 3.6+ features (
pathlib
, ordered dicts, andf-strings
).