Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add background potential energy computation #172
base: main
Are you sure you want to change the base?
Add background potential energy computation #172
Changes from 24 commits
5efa6a6
7113697
1590116
8ace5a8
5d2eee1
84265a8
44d81c5
9362a27
fbe8c02
e59fbad
1ac15f3
6d3d7da
62b0a47
1c73077
2c4faad
0a87fbb
73479d5
dfbbcd4
f28a26a
aad59a9
6251dc8
2e98f34
38b9a83
24b658c
3107ec6
23d095d
769ecc0
44c0206
ac0ed37
8689673
8219b78
71b5537
82c2421
d4d396e
63a58b2
3f752bf
1fd9d64
7514adf
7cbc052
2ec9e41
08832ae
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we usually prefer multiple dispatch but there's a lot of overlap between these four functions. Should we put everything into one or two functions and just use plain old if/else statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"multiple dispatch" is not the reason why you can't achieve code re-use here.
if
statements are fine too though, I just think you want to think clearly about the changes that are needed. Re-using code is about observing patterns and creating abstractions that generalize concepts. You can achieve that in code that uses if statements or in code that uses multiple dispatch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure! I did it like this because I thought it would make it easy to see how the computations are done for the different
Buoyancy
models. I will try and simplify.