Skip to content
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

Decide on consistent naming for Base/Abstract classes #170

Open
mscroggs opened this issue Jun 8, 2023 · 2 comments
Open

Decide on consistent naming for Base/Abstract classes #170

mscroggs opened this issue Jun 8, 2023 · 2 comments
Labels

Comments

@mscroggs
Copy link
Member

mscroggs commented Jun 8, 2023

Currently, the base class for finite element is called FiniteElementBase while the base class for cells is called AbstractCell.

We should decide on a consistent naming for base classes. I'm in favour of the ObjectNameBase but am open to better opinions.

@wence-
Copy link
Collaborator

wence- commented Jun 8, 2023

FooBase to me tends to suggest a concrete class that provides implementation for which one must call __init__, whereas AbstractFoo suggests an interface that a subclass must conform to (and therefore one doesn't need to call __init__). In #168 you're making an interface, so I think AbstractCell is right.

FiniteElementBase at the moment is in a superposition between these two states. It is kind of an interface, but requires that its subclasses set up the superclass appropriately (which some subclasses don't do and have to hack around). This has caused a bunch of pain in the past which I'm sure you are aware of! I think (although it's been a while since I looked concretely here) that the FiniteElementBase object should be an interface with no implementation and therefore by my internal guidelines would be named AbstractFiniteElement.

@mscroggs
Copy link
Member Author

mscroggs commented Jun 8, 2023

FiniteElementBase at the moment is in a superposition between these two states. It is kind of an interface, but requires that its subclasses set up the superclass appropriately (which some subclasses don't do and have to hack around). This has caused a bunch of pain in the past which I'm sure you are aware of! I think (although it's been a while since I looked concretely here) that the FiniteElementBase object should be an interface with no implementation and therefore by my internal guidelines would be named AbstractFiniteElement.

I'm working towards removing the __init__ from FiniteElementBase and making it more like an interface. I think it makes sense to then rename it AbstractFiniteElement.

@mscroggs mscroggs changed the title Decide on consistent naming for Base classes Decide on consistent naming for Base/Abstract classes Jun 8, 2023
@mscroggs mscroggs added this to newFL Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants