The code is quite far from a minimal example.
A minimal example consists of:
- The minimal amount of code to reproduce your error
This means that all variables, attributes,classes not required to reproduce the error should be removed.
The reason for this is that it is otherwise quite a lot of work that goes into understanding all the things done in your code.
See for instance:
Read before posting: How do I get my question answered? - #4 by nate for examples of MWEs.