-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix code style issues flagged by LGTM #1559
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,14 +225,19 @@ def read_epw(filename, coerce_year=None): | |
| 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 ' | ||
| 'Safari/537.36')}) | ||
| response = urlopen(request) | ||
| csvdata = io.StringIO(response.read().decode(errors='ignore')) | ||
| with io.StringIO(response.read().decode(errors='ignore')) as csvdata: | ||
| try: | ||
| data, meta = parse_epw(csvdata, coerce_year) | ||
| except Exception as e: | ||
| print(e) | ||
| else: | ||
| # Assume it's accessible via the file system | ||
| csvdata = open(str(filename), 'r') | ||
| try: | ||
| data, meta = parse_epw(csvdata, coerce_year) | ||
| finally: | ||
| csvdata.close() | ||
| with open(str(filename), 'r') as csvdata: | ||
| try: | ||
| data, meta = parse_epw(csvdata, coerce_year) | ||
| except Exception as e: | ||
| print(e) | ||
|
||
|
|
||
| return data, meta | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ | |
|
|
||
| import os | ||
| import datetime | ||
| import warnings | ||
|
|
||
| import pandas as pd | ||
| import pytz | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| #!/usr/bin/env python | ||
|
|
||
| import os | ||
| import sys | ||
|
|
||
| try: | ||
| from setuptools import setup, find_namespace_packages | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.