scalableminds / webknossos-connect

Connect webKnossos with existing datasets (BossDB, Neuroglancer Precomputed)
GNU Affero General Public License v3.0
0 stars 0 forks source link

use namedtuple, dataclass & abc #41

Closed jstriebel closed 5 years ago

jstriebel commented 5 years ago

Using namedtuple we get rid of some boilerplate code, also this should be more efficient. Unfortunately we loose the assertion checks for now, see https://github.com/python/typing/issues/526

jstriebel commented 5 years ago

@fm3 I used dataclass now, which perfectly fits our needs. If it's used with frozen=True, it also defines __hash__, and it has a __post_init__ hook :tada: I also sneaked in abstract base classes here. Could you have a second glance with the changes?

fm3 commented 5 years ago

Yes I like that a lot better :) Thanks!