sourcery refactoring
I tried applying https://sourcery.ai/github/ , seems like there's some nice suggestions here. I removed the ones where they change things like
```diff
- if param:
-     var = a
- else:
-     var = b
+ var = a if param else b
```
+1 in principal. opinionated is good imo on a project with a large number of contributors. @simonjayhawkins do you think we should keep the
```diff
- if param:
-     var = a
- else:
-     var = b
+ var = a if param else b
```
-style changes then? those changes can sometimes be beneficial for mypy, sometimes the opposite. It depends on the inference. So i'm ok with allowing those changes and seeing if we run into issues.