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

Workflows #111

Merged
merged 1 commit into from
Sep 24, 2018
Merged

Workflows #111

merged 1 commit into from
Sep 24, 2018

Conversation

sdc50
Copy link
Member

@sdc50 sdc50 commented Sep 14, 2018

Testing notebooks



logging.getLogger('ulmo').propagate = False
from . import tools # NOQA

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E261 at least two spaces before inline comment

@@ -157,3 +159,8 @@
cancel_tasks,
remove_tasks,
)

from .workflows import (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E402 module level import not at top of file

datasets = list(matched.values())


# stage the data for download, optional parameters can be provided here

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 (2)

db = get_db()
with db_session:
datasets = db.Dataset.select(lambda d: d.feature.name in collection_features
and d.status == DatasetStatus.DOWNLOADED,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W503 line break before binary operator

with db_session:
datasets = db.Dataset.select(lambda d: d.feature.name in collection_features
and d.status == DatasetStatus.DOWNLOADED,
)# and d.options == download_options)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E261 at least two spaces before inline comment

@@ -308,6 +327,11 @@ def parse_service_uri(uri):

return provider, service, feature

def setattr_on_dataframe(df, attr, value, warnings_filter='ignore'):

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

service_param.default = default or services[0]
super().__init__(name='')

class PublisherSelector(param.Parameterized):

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

@@ -4,5 +4,5 @@
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, Service
from .param_util import format_json_options, NamedString, ServiceSelector, PublisherSelector

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 '.param_util.ServiceSelector' imported but unused
F401 '.param_util.format_json_options' imported but unused
F401 '.param_util.NamedString' imported but unused
F401 '.param_util.PublisherSelector' imported but unused

@@ -1,10 +1,13 @@
import json
import os
import warnings

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'warnings' imported but unused

@@ -7,7 +7,7 @@
import param

from .ts_base import TsBase
from quest.util import unit_registry, unit_list
from quest.util import unit_registry, unit_list, setattr_on_dataframe

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'quest.util.unit_registry' imported but unused
F401 'quest.util.unit_list' imported but unused

setattr(df, attr, value)


def setattr_on_dataframe(df, attr, value, warnings_filter='ignore'):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F811 redefinition of unused 'setattr_on_dataframe' from line 308

@coveralls
Copy link

coveralls commented Sep 17, 2018

Pull Request Test Coverage Report for Build 418

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 118 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.2%) to 69.585%

Files with Coverage Reduction New Missed Lines %
/Users/travis/miniconda/envs/test-environment/lib/python3.5/site-packages/quest/util/config.py 3 89.55%
/Users/travis/miniconda/envs/test-environment/lib/python3.5/site-packages/quest/util/param_util.py 21 69.05%
/Users/travis/miniconda/envs/test-environment/lib/python3.5/site-packages/quest/util/misc.py 34 76.51%
/Users/travis/miniconda/envs/test-environment/lib/python3.5/site-packages/quest/api/datasets.py 60 54.85%
Totals Coverage Status
Change from base Build 387: -0.2%
Covered Lines: 1526
Relevant Lines: 2193

💛 - Coveralls

@AaronV77
Copy link
Collaborator

@sdc50 why is the WMTS notebook being added to this PR?


expected = [180]
actual = quest.util.listify(expected[0])
assert expected == actual

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

@sdc50
Copy link
Member Author

sdc50 commented Sep 19, 2018

@AaronV77 I've made changes to the notebooks to leverage the new workflows interface. I've also made running the notebooks part of the tests. I'm just trying to get everything working on CI so it's ready to merge after PR #110 get merged in.

@AaronV77
Copy link
Collaborator

@sdc50 alright that makes sense. Can you make sure that the notebook(s) output are cleared out. Thanks

@sdc50 sdc50 force-pushed the workflows branch 2 times, most recently from bd0e75e to b0acfd6 Compare September 21, 2018 18:31
del catalog_entries['bbox']

if {'latitude', 'longitude'}.issubset(catalog_entries.columns):
fn = lambda row: Point((

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E731 do not assign a lambda expression, use a def

extra_fields = list(set(catalog_entries.columns.tolist()) - set(reserved_catalog_entry_fields))
# change NaN to None so it can be JSON serialized properly
catalog_entries['metadata'] = [{k: None if v != v else v for k, v in record.items()}
for record in catalog_entries[extra_fields].to_dict(orient='records')]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent

params = self.get_parameters(catalog_ids=catalog_entries)
if isinstance(params, pd.DataFrame):
groups = params.groupby('service_id').groups
catalog_entries['parameters'] = catalog_entries.index.map(lambda x: ','.join(filter(None, params.loc[groups[x]]['parameter'].tolist())) if x in groups.keys() else '')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (178 > 120 characters)


with rasterio.open(dst) as f:
with rasterio.open(file_path) as f:

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 (2)

import param
import ulmo
from shapely.geometry import box, Point, shape

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'shapely.geometry.shape' imported but unused


if {'latitude', 'longitude'}.issubset(catalog_entries.columns):
fn = lambda row: Point((
float(row['longitude']),

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

fn = lambda row: Point((
float(row['longitude']),
float(row['latitude'])
))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E123 closing bracket does not match indentation of opening bracket's line

@sdc50
Copy link
Member Author

sdc50 commented Sep 21, 2018

@AaronV77 This is ready for review. I just pulled the usgs_ned:19-arc-second tests out since the service isn't being consistent right now.

* Testing notebooks
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