-
Notifications
You must be signed in to change notification settings - Fork 9
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
Enhance tools #104
Enhance tools #104
Conversation
sdc50
commented
Aug 27, 2018
- enhance tools api
- clean up old tools
- add whitebox_tools for watershed tools
* clean up old tools * add whitebox_tools for watershed tools
quest/plugins/base/tool_base.py
Outdated
@@ -3,8 +3,7 @@ | |||
from quest.static import DatasetStatus | |||
from quest.util import listify, format_json_options | |||
|
|||
|
|||
class ToolBase(param.Parameterized): | |||
class ToolBase(param.ParameterizedFunction): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
quest_io_plugins/raster_gdal.py
Outdated
"Open raster and return in requested format" | ||
raster_data = self.read(path) | ||
|
||
if fmt == None or fmt.lower() == 'rasterio': | ||
if fmt == None or fmt.lower() == 'xarray': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E711 comparison to None should be 'if cond is None:'
quest_io_plugins/raster_gdal.py
Outdated
"Open raster and return in requested format" | ||
raster_data = self.read(path) | ||
|
||
if fmt == None or fmt.lower() == 'rasterio': | ||
if fmt == None or fmt.lower() == 'xarray': | ||
xarr = xr.open_rasterio(path, parse_coordinates=True).isel(band=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E222 multiple spaces after operator
|
||
stream_threshold = param.Number( | ||
default=1, | ||
bounds=(0,1000), # TODO is there a way to not have an upper bound? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E231 missing whitespace after ','
|
||
|
||
|
||
# algorithm = param.ObjectSelector(default="go-fill", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E303 too many blank lines (3)
|
||
update_metadata(new_dset, quest_metadata=quest_metadata) | ||
|
||
return {'datasets': new_dset, 'features': [new_features, snapped_outlets]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W292 no newline at end of file
@@ -10,11 +10,13 @@ | |||
import pbr.version | |||
import warnings | |||
import logging | |||
from . import tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 '.tools' imported but unused
|
||
shape = xr_data.shape | ||
if len(shape) == 2: | ||
shape = (1, *shape) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E999 SyntaxError: invalid syntax
docs = {k: v.strip() for k, v in re.findall('^\s*(.*) -- (.*)', tool.__doc__, re.MULTILINE)} | ||
|
||
df = pd.DataFrame([ | ||
{'tool': tool.__name__, 'arg_name': k, 'doc': v} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E126 continuation line over-indented for hanging indent
|
||
from quest.plugins import ToolBase | ||
from quest import util | ||
from quest.api import get_metadata, new_dataset, update_metadata, new_feature, open_dataset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'quest.api.new_feature' imported but unused
quest/tools/__init__.py
Outdated
def codify(name): | ||
return name.lower().replace('-', '_').replace(' ', '_') | ||
|
||
for tool_name, tool in tools.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E305 expected 2 blank lines after class or function definition, found 1
quest/util/__init__.py
Outdated
from .misc import * | ||
from .io import read_yaml, write_yaml | ||
from .config import get_settings, save_settings, update_settings, update_settings_from_file | ||
from .log import logger, log_to_console, log_to_file | ||
from . import param_util as param | ||
from .param_util import format_json_options, NamedString | ||
from .param_util import format_json_options, Service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 '.param_util.Service' imported but unused
F401 '.param_util.format_json_options' imported but unused
@@ -0,0 +1,7 @@ | |||
# noqa: F401 | |||
|
|||
from .whitebox_watershed import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 '.whitebox_watershed.WBTFillDepressions' imported but unused
F401 '.whitebox_watershed.WBTExtractStreamsWorkflow' imported but unused
F401 '.whitebox_watershed.WBTWatershedDelineationWorkflow' imported but unused
from .misc import * | ||
from .io import read_yaml, write_yaml | ||
from .config import get_settings, save_settings, update_settings, update_settings_from_file | ||
from .log import logger, log_to_console, log_to_file | ||
from . import param_util as param | ||
from .param_util import format_json_options, NamedString | ||
from .param_util import format_json_options, NamedString, Service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 '.param_util.Service' imported but unused
F401 '.param_util.format_json_options' imported but unused
F401 '.param_util.NamedString' imported but unused