Skip to content
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

Merged
merged 8 commits into from
Aug 31, 2018
Merged

Enhance tools #104

merged 8 commits into from
Aug 31, 2018

Conversation

sdc50
Copy link
Member

@sdc50 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
@@ -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):

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

"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':

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:'

"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)

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?

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",

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]}

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

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)

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}

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

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

def codify(name):
return name.lower().replace('-', '_').replace(' ', '_')

for tool_name, tool in tools.items():

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

@erdc erdc deleted a comment from stickler-ci Aug 28, 2018
@erdc erdc deleted a comment from stickler-ci Aug 28, 2018
@erdc erdc deleted a comment from stickler-ci Aug 28, 2018
@erdc erdc deleted a comment from stickler-ci Aug 28, 2018
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

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 (

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

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

@AaronV77 AaronV77 merged commit ea2d856 into erdc:master Aug 31, 2018
@sdc50 sdc50 deleted the enhance_tools branch September 19, 2018 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants