Can Composites and Components be abstract classes? #1214
drewj-usnctech
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've made a couple issues about adding new
Composite
subclasses into ARMI (#1134 #1030 #1088) and we've also been exploring adding newComponent
types to handle new geometries. We know there are methods that we should add to make these classes be more compliant with the ARMI data model, but the process of finding them really boils down to what raises aNotImplementedError
somewhere in thearmi run
stack or in tests. However, ifComposite
andComponent
were abstract classes, we could find out as soon as something tried to create our new class.It's a little trickier to make
Composite
andComponent
abstract because of themetaclass
mechanics onCompositeModelType
andComponentType
. It's not impossible as you would need to make those metaclasses a subclass ofabc.ABCMeta
. I added the following in #1088The next step is to find out what methods should be marked as
abstractmethod
so subclass implementers know what they need to do. The following stand outComponent.getBoundingCircleOuterDiameter
Component.getArea
Component.getVolume
Component.getComponentArea
:: maybe redundant w/Component.getArea
Most of the abstract methods would be on the leaves of the tree (
Component
) because other members of the tree just need their children to provide some base functionality that can be used. LikeBlock.getMass
sums the mass of the children, and eventually requiringComponent.getMass
to be properly definedBeta Was this translation helpful? Give feedback.
All reactions