-
Notifications
You must be signed in to change notification settings - Fork 99
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
(WIP) Combine boundary condition setting so that both q
and aux
are available to these functions
#450
Conversation
Removes specfic BC routines _apply_q_bcs and _apply_aux_bcs to provide a clean interface to boundary condtions. Currently works with non-custom boundary conditions.
Also clean up a bit of the code
Looks great. Thanks for resurrecting this! My thoughts:
|
Upon further reflection I think you are right about this, I will have to implement something that checks the type of array input (probably using *args).
Yeah, sorry, was being lazy when comparing the old code to the new. I will be removed.
I originally was thinking along these lines but then thought it would be better to do the option that leaves the most control and least duplication of code available. We could provide convenience routines to do this. One thing of note, since both |
That solution seems a bit extreme (throwing out the baby with the bathwater and all that...) ;-)
Okay, fair enough. I'm +1 for merging once the commented code is cleaned out. |
Any ideas on how to do introspection on the passed variable names so I can detect whether the aux or q arrays have been passed? I am trying to avoid using an extra argument (although that's the easiest path forward). |
A really quick and dirty approach:
The TypeError gets thrown if you pass the wrong number of arguments. It's not pretty, but we're going to remove it eventually. I will understand if you slap my hand for this. |
That was what I was thinking for that problem actually. The problem I am thinking of is how I could determine which array was passed to one of the |
Also add a warning message to tell users to change their function signatures.
I added something along the lines @ketch suggested and added a tidbit in the docs to describe the change clawpack/doc/pull/62. |
Please see issue #92 for the relevant discussion as to what this PR is supposed to solve and some of the issues with this implementation.