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

Minor improvements to code #79

Merged
merged 4 commits into from
Nov 7, 2024
Merged

Minor improvements to code #79

merged 4 commits into from
Nov 7, 2024

Conversation

dbrakenhoff
Copy link
Collaborator

make Element Abstract Base Class
use builtin types to intialize arrays
use super where appropriate

- use builtin types to initialize arrays
- use super()
- label methods abstractmethods
- add ax to plot
@dbrakenhoff dbrakenhoff changed the base branch from master to dev November 7, 2024 12:30
@dbrakenhoff dbrakenhoff requested a review from mbakker7 November 7, 2024 12:30
@dbrakenhoff dbrakenhoff linked an issue Nov 7, 2024 that may be closed by this pull request
Copy link
Owner

@mbakker7 mbakker7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes.
Only remaining one I found in element.py was

def run_after_solve(self): # noqa: B027

Any reason that is not just a regular abstractmethod?

@dbrakenhoff
Copy link
Collaborator Author

Good changes. Only remaining one I found in element.py was

def run_after_solve(self): # noqa: B027

Any reason that is not just a regular abstractmethod?

Yea, this function is only implemented in some elements, the rest just uses the Element version (which does nothing). We could make it an abstractmethod but then we would have to implement it in each Base Element. Since it's only needed in special cases I figured it would be fine for new elements to be not necessarily have to implement this function.

@dbrakenhoff dbrakenhoff merged commit ef083da into dev Nov 7, 2024
6 checks passed
@dbrakenhoff dbrakenhoff deleted the elementABC branch November 7, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete aquifernew.py
2 participants