-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from jdhughes-usgs/pws_deps
more pywatershed updates
- Loading branch information
Showing
12 changed files
with
2,036 additions
and
624 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,33 @@ | ||
import pathlib as pl | ||
|
||
from IPython.core.magic import register_cell_magic | ||
|
||
|
||
@register_cell_magic | ||
def do_not_run_this_cell(line, cell): | ||
return | ||
|
||
|
||
def read_yaml(yaml_file: pl.Path) -> dict: | ||
import yaml | ||
|
||
with pl.Path(yaml_file).open("r") as file_stream: | ||
yaml_dict = yaml.load(file_stream, Loader=yaml.Loader) | ||
return yaml_dict | ||
|
||
|
||
def write_yaml(yaml_dict: dict, yaml_file: pl.Path): | ||
import yaml | ||
|
||
with open(yaml_file, "w") as file: | ||
_ = yaml.dump(yaml_dict, file) | ||
return None | ||
|
||
|
||
def help_head(what, n=22): | ||
"""Equivalent to help() but we get the multiline string and just look the first n lines.""" | ||
import pydoc | ||
|
||
the_help = pydoc.render_doc(what, "Help on %s") | ||
print("\n".join(the_help.splitlines()[0:n])) | ||
return |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.