Skip to content

Commit 87ce5f3

Browse files
committed
FORM: black isort
1 parent a64e273 commit 87ce5f3

File tree

6 files changed

+22
-38
lines changed

6 files changed

+22
-38
lines changed

eemont/__init__.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22

33
__version__ = "0.3.0"
44

5-
from . import (
6-
app,
7-
dataframe,
8-
eeDictionary,
9-
eeList,
10-
extra,
11-
feature,
12-
featurecollection,
13-
geometry,
14-
image,
15-
imagecollection,
16-
number,
17-
)
5+
from . import (app, dataframe, eeDictionary, eeList, extra, feature,
6+
featurecollection, geometry, image, imagecollection, number)
187
from .common import *

eemont/app.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import webbrowser
2-
import requests
31
import json
4-
import ee
2+
import webbrowser
53

4+
import ee
5+
import requests
66
from box import Box
77
from bs4 import BeautifulSoup
88
from ee_extra.Apps.core import apps as extra_apps
99

1010
from .extending import extend
1111

12+
1213
@extend(ee)
13-
class App():
14+
class App:
1415
"""Google Earth Engine App Manager and Descriptor.
1516
1617
Inspect, open and download Google Earth Engine apps.
@@ -36,7 +37,9 @@ def __init__(self, url):
3637
if "users.earthengine.app" not in url:
3738
raise Exception("Not a valid Earth Engine App! Check the url again!")
3839
if "users.earthengine.app/view/" not in url:
39-
raise Exception("This seems to be an Earth Engine App Collection! Please use the url of an app!")
40+
raise Exception(
41+
"This seems to be an Earth Engine App Collection! Please use the url of an app!"
42+
)
4043

4144
self.url = url
4245
"""URL of the App."""
@@ -68,7 +71,7 @@ def open(self):
6871
"""
6972
webbrowser.open(self.url)
7073

71-
def download(self, file = None):
74+
def download(self, file=None):
7275
"""Downloads the current app to a JS file.
7376
7477
Parameters
@@ -89,7 +92,7 @@ def download(self, file = None):
8992
r = requests.get(self.url)
9093
r = BeautifulSoup(r.text)
9194
r = r.find_all("main")[0].find("script").string
92-
app_url = re.findall(r'init\((.*?)\)',r)[0].replace('"','').replace("'","")
95+
app_url = re.findall(r"init\((.*?)\)", r)[0].replace('"', "").replace("'", "")
9396
r = requests.get(app_url).json()
9497
path = r["path"]
9598
r = r["dependencies"][path]
@@ -100,13 +103,13 @@ def download(self, file = None):
100103

101104

102105
@extend(ee)
103-
def listApps(online = False):
106+
def listApps(online=False):
104107
"""Gets the dictionary of available Google Earth Engine Apps from ee-appshot [1]_.
105108
106109
Parameters
107110
----------
108111
online : boolean
109-
Whether to retrieve the most recent list of apps directly from the GitHub
112+
Whether to retrieve the most recent list of apps directly from the GitHub
110113
repository and not from the local copy.
111114
112115
Returns
@@ -144,5 +147,5 @@ def __repr__(self):
144147
if "users.earthengine.app/view/" in app:
145148
the_app = App(app)
146149
apps_extra[user][the_app.name] = the_app
147-
148-
return GoogleEarthEngineApps(apps_extra,frozen_box = True)
150+
151+
return GoogleEarthEngineApps(apps_extra, frozen_box=True)

eemont/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import ee_extra.Spectral.core
1111
import ee_extra.STAC.core
1212
import ee_extra.STAC.utils
13-
from ee_extra.STAC.utils import _get_platform_STAC
1413
import pkg_resources
1514
import requests
1615
from box import Box
16+
from ee_extra.STAC.utils import _get_platform_STAC
1717
from geopy.geocoders import get_geocoder_for_service
1818

1919
from .extending import extend

eemont/geometry.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
import geopy
33
from geopy.geocoders import get_geocoder_for_service
44

5-
from .common import (
6-
_convert_lnglats_to_pluscodes,
7-
_convert_pluscodes_to_lnglats,
8-
_lnglat_from_location,
9-
_retrieve_location,
10-
)
5+
from .common import (_convert_lnglats_to_pluscodes,
6+
_convert_pluscodes_to_lnglats, _lnglat_from_location,
7+
_retrieve_location)
118
from .extending import extend
129

1310

eemont/image.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import ee_extra.Spectral.core
66
import requests
77

8-
from .common import (
9-
_matchHistogram,
10-
_panSharpen,
11-
)
8+
from .common import _matchHistogram, _panSharpen
129
from .extending import extend
1310

1411

eemont/imagecollection.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
import numpy as np
77
import requests
88

9-
from .common import (
10-
_panSharpen,
11-
)
9+
from .common import _panSharpen
1210
from .extending import extend
1311

1412

0 commit comments

Comments
 (0)