-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: jit significant portions of the water and sediment routing
This makes them available outside the object, which is important in some cases, and the class just gets them from here. feat: make shared_tools into a module, not a class. This is in preparation for jitting, since we want them to be standalone functions. feat: break out step that updates water parcel positions These functions now become helper utility functions in shared_tools, and are wrapped by update_Q, which handles them all, and passes them what they need. refactor: break out sed functions into smaller functions This modularizes the code and makes it easier to compile. feat: jit the functions apply jit to functions, and fix some type problems that came along with refactoring. refactor: move next step calculation to jitted functions The next slowest operation was getting the indexes of the next cells, so I moved that to a jitted function too. refactor: jit the calculation of weight array for the water fix: move random number generation into numba Copy of what @amoodie did in #27 fix: some broken tests to test the shared tools portion. fix: add numba to requirements fix: move all inlet picking into the random_pick function There's essentially no difference between the random_pick function and the random_pick_inlet function other than there is no preference given for the inlet cells, so you can pick whichever one, so I just adjust the mechanism to use the existing random pick machinery. fix: water and sediment routing bugs that caused inconsistent behavior There were two issues with the refactoring. One was that water routing developed a flat flow field because I wasn't adding each passing water parcel to the Q field. The other was related to sediment parcel routing, where I had transcribed the i and j of stepping incorrectly in the jitted functions.
- Loading branch information
1 parent
b5e3bcf
commit ef18f96
Showing
9 changed files
with
303 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.