-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8012c32
commit a7913b2
Showing
8 changed files
with
383 additions
and
166 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# River Route | ||
|
||
`river-route` is a Python package for routing runoff through a river network. | ||
The routing calculations are vectorized and use numpy and scipy which keeps the array computation times on par with faster compiled languages. | ||
|
||
The implemented routing methods are: | ||
- Muskingum Cunge - Analytical solution | ||
- Muskingum Cunge - Numerical solution | ||
|
||
## Quick Start Guide | ||
You will need to prepare a configuration file for the routing. | ||
|
||
```python | ||
import river_route as rr | ||
|
||
rm = rr.RouteMuskingum('/path/to/config.yml') | ||
rm.route() | ||
|
||
river_id_to_inspect = 12345 | ||
rm.plot(river_id_to_inspect) | ||
``` | ||
|
||
## Tips for efficient computations | ||
Results will vary based on your system specifications, the size of the river network, and the length of the simulation. | ||
These tips may help you achieve faster results. | ||
|
||
1. **Use fewer inflow files**: File IO operations can be relatively slow and are a probable bottleneck on HPC systems | ||
when I/O operations depend on networked drives. You may achieve faster results by doing a single computation | ||
covering 2 weeks instead of 14 computations covering 1 day each. | ||
2. **Cache routing Matrices**: The adjacency matrix and inverted I-C2@A matrix can be time consuming to compute. Provide | ||
paths to store them in the config file to cache them between simulations | ||
3. **Adjust the time step**: Using a longer time step will reduce the number of computations which takes less time to | ||
compute. It also requires storing fewer intermediate results in memory yielding a modest reduction in memory usage. A | ||
longer time step can increase performance if it does not induce numerical instability in the outflows. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: rr | ||
channels: | ||
- conda-forge | ||
- defaults | ||
dependencies: | ||
- dask | ||
- fastparquet | ||
- matplotlib | ||
- netcdf4 | ||
- networkx | ||
- numpy | ||
- pandas | ||
- petsc4py | ||
- pyyaml | ||
- scipy | ||
- tqdm | ||
- xarray | ||
- zarr |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
dask | ||
fastparquet | ||
matplotlib | ||
netcdf4 | ||
networkx | ||
numpy | ||
pandas | ||
petsc4py | ||
pyyaml | ||
scipy | ||
tqdm | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
from river_route._route_muskingum import RouteMuskingum | ||
|
||
__version__ = '0.1.0' | ||
__author__ = 'Riley Hales PhD' | ||
__url__ = 'https://github.com/rileyhales/river_route' | ||
|
||
__all__ = [ | ||
'RouteMuskingum', | ||
|
||
__version__, | ||
__author__, | ||
__url__ | ||
] |
Oops, something went wrong.