-
Notifications
You must be signed in to change notification settings - Fork 8
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
move to _model.py naming scheme for base objects which are subclassed (datablock, multiblock, naparidepictor) #74
Comments
Im not sure about this; isn't the whole point of "models" in napari to separate the logic from specifically the GUI? AFAIK the whole model thing is simply a way to implement the event loop and all the logic related to it without depending on the qt frontend. Am I wrong? As for our case: there was really no reason to keep the abstract classes, since it added nothing. The only use it had was to enforce the implementation of Where do you see a need/benefit of using abstract classes and/or "models"? |
Generally I just like the abstract class pattern, my feelings pretty much align with what this person thinks in that it's just the right object for the job (we never instantiate datablocks directly) I'm not excessively bothered by it though and happy to go either way! For the models, you might be right about the event loop stuff but more broadly I like the idea of it being obvious where all of the base components are and their implementations separate - for creating this separation there are two solutions
What're your thoughts? |
I see your point about abstract classes... Maybe that's better! But yeah, function-wise it's not that important. As for models: I still don't get it... can you give me a practical example for peepingtom? What would you split into a "model" and its "implementation", how roughly? |
Yep sure The DataBlock class would be a 'model' the way I'm seeing it, either as an abstract class in its own file in a |
So you're basically saying that we should make This is what we had at some point, with a |
not necessarily changing the name of the class, just indicating in the file name that it's a model - I actually prefer the other option I suggested, having all of the base classes as |
Addressed this with the addition of abstract classes in #84. Names stayed more or less the same, but they are logically separated by the rest. |
I like the pattern used in napari etc for naming these things 'viewer_model', 'layer_model' etc. It clearly separates the abstract from the concrete implementations wthout needing to explicitly write abstract base classes
Why did we move away from using abstract base classes for these in the first place?
The text was updated successfully, but these errors were encountered: