You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, the number of attributes of the layer class has exploded :)
This is because we implemented some very cool new features and simulations.
However, it also makes the interface for the user very overloaded if you actually just need one or two attributes for your simulations.
I already thought a bit about how to separate the parameters, maybe into dictionaries or something alike.
But I think, it would be more pythonic to use inheritance here.
In reality, it would mean that the user has to choose the right type of layer for the simulations.
There could be still the general Layer as the base class.
Then you could decide whether it is amorphous or crystalline and add properties by inheriting e.g. from a MagneticLayer or an AccousticLayer.
Obviously, the naming might be a bit crude, but the concept should work.
However, we need to define most of the relevant layer types in the modules so the user does not have to do it in the script.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Recently, the number of attributes of the
layer
class has exploded :)This is because we implemented some very cool new features and simulations.
However, it also makes the interface for the user very overloaded if you actually just need one or two attributes for your simulations.
I already thought a bit about how to separate the parameters, maybe into dictionaries or something alike.
But I think, it would be more pythonic to use inheritance here.
In reality, it would mean that the user has to choose the right
type
oflayer
for the simulations.There could be still the general
Layer
as the base class.Then you could decide whether it is amorphous or crystalline and add properties by inheriting e.g. from a
MagneticLayer
or anAccousticLayer
.Obviously, the naming might be a bit crude, but the concept should work.
However, we need to define most of the relevant layer types in the modules so the user does not have to do it in the script.
Maybe someone has a smarter idea for that?
Beta Was this translation helpful? Give feedback.
All reactions