You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Might it be more sensible to check for overlapping bcs and source terms at run time, rather than when the user sets them?
At the moment the set_rate_bc and set_value_bc methods, as well as the set_source method all make sure there are no collisions between BCs and sources. I wonder if it'd be more logical to just check these at run time using some _validate_bcs logic like we do with all the other validations.
The reason for doing this is that we probably SHOULD be checking at run time anyway, since it's technically possible to specify BCs by fiddling with the 'pore.bc_value' and 'pore.bc_rate' arrays directly anyway. So if we move the checks to runtime, then no problems will sneak past.
Downsides:
users don't get immediate feedback about errors
Upsides:
The code would be much simpler since all arrays would be 'final' and could be checked in one go.
The text was updated successfully, but these errors were encountered:
I agree. Either we need to somehow prevent users from manually reaching into pore.bc_* arrays, which I don't think is a good idea, OR we need to defer the health check until runtime.
In other words, in its current form, OpenPNM could be silently misused.
Might it be more sensible to check for overlapping bcs and source terms at run time, rather than when the user sets them?
At the moment the
set_rate_bc
andset_value_bc
methods, as well as theset_source
method all make sure there are no collisions between BCs and sources. I wonder if it'd be more logical to just check these at run time using some_validate_bcs
logic like we do with all the other validations.The reason for doing this is that we probably SHOULD be checking at run time anyway, since it's technically possible to specify BCs by fiddling with the
'pore.bc_value'
and'pore.bc_rate'
arrays directly anyway. So if we move the checks to runtime, then no problems will sneak past.Downsides:
Upsides:
The text was updated successfully, but these errors were encountered: