Skip to content

Commit 1f9e3c5

Browse files
committed
updated v0.6.5
- Fixed issue with iteritems for pandas >2.0.0 - Updated task running check and updated function - Updated handling boolean for using last band as alpha mask
1 parent 1fd3d96 commit 1f9e3c5

File tree

6 files changed

+31
-39
lines changed

6 files changed

+31
-39
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ optional arguments:
340340

341341
# Changelog
342342

343+
### 0.6.5
344+
- Fixed issue with iteritems for pandas >2.0.0
345+
- Updated task running check and updated function
346+
- Updated handling boolean for using last band as alpha mask
347+
343348
### 0.6.4
344349
- Added masking option to use last band as mask
345350

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
### 0.6.5
4+
- Fixed issue with iteritems for pandas >2.0.0
5+
- Updated task running check and updated function
6+
- Updated handling boolean for using last band as alpha mask
7+
38
### 0.6.4
49
- Added masking option to use last band as mask
510

geeup/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = "Samapriya Roy"
44
__email__ = "samapriya.roy@gmail.com"
5-
__version__ = "0.6.4"
5+
__version__ = "0.6.5"

geeup/batch_uploader.py

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__copyright__ = """
44
5-
Copyright 2016 Lukasz Tracewski
5+
Copyright 2023 Samapriya Roy
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -19,32 +19,6 @@
1919
"""
2020
__license__ = "Apache 2.0"
2121

22-
__Modifications_copyright__ = """
23-
24-
Copyright 2022 Samapriya Roy
25-
26-
Licensed under the Apache License, Version 2.0 (the "License");
27-
you may not use this file except in compliance with the License.
28-
You may obtain a copy of the License at
29-
30-
http://www.apache.org/licenses/LICENSE-2.0
31-
32-
Unless required by applicable law or agreed to in writing, software
33-
distributed under the License is distributed on an "AS IS" BASIS,
34-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35-
See the License for the specific language governing permissions and
36-
limitations under the License.
37-
38-
"""
39-
__license__ = "Apache 2.0"
40-
41-
"""
42-
Modifications to file:
43-
- Uses cookie based upload
44-
- Removed multipart upload
45-
- Uses polling
46-
"""
47-
4822
import ast
4923
import csv
5024
import glob
@@ -84,6 +58,19 @@ def _format_message(self, field, error):
8458
return "GEE file name & path cannot have spaces & can only have letters, numbers, hyphens and underscores"
8559

8660

61+
def task_counter():
62+
ee.Initialize()
63+
status = ["RUNNING", "PENDING"]
64+
task_count = len(
65+
[
66+
task
67+
for task in ee.data.listOperations()
68+
if task["metadata"]["state"] in status
69+
]
70+
)
71+
return task_count
72+
73+
8774
def upload(
8875
user,
8976
source_path,
@@ -133,19 +120,13 @@ def upload(
133120
# logging.info(
134121
# f"Processing image {current_image_no + 1} out of {no_images} : {image_path}"
135122
# )
136-
status = ["RUNNING", "PENDING"]
137-
task_count = len(
138-
[
139-
task
140-
for task in ee.data.listOperations()
141-
if task["metadata"]["state"] in status
142-
]
143-
)
144-
while task_count >= 2500:
123+
task_count = task_counter()
124+
while task_count >= 2800:
145125
logging.info(
146126
f"Total tasks running or submitted {task_count}: waiting for 5 minutes"
147127
)
148128
time.sleep(300)
129+
task_count = task_counter()
149130
filename = __get_filename_from_path(path=image_path)
150131

151132
destination_path = ee.data.getAsset(destination_path + "/")["name"]
@@ -165,7 +146,7 @@ def upload(
165146

166147
df = pd.read_csv(metadata_path)
167148
dd = (df.applymap(type) == str).all(0)
168-
for ind, val in dd.iteritems():
149+
for ind, val in dd.items():
169150
if val == True:
170151
slist.append(ind)
171152
intcol = list(df.select_dtypes(include=["int64"]).columns)

geeup/geeup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ def main(args=None):
566566
optional_named.add_argument(
567567
"--mask",
568568
default=False,
569+
choices=('True', 'False', 't', 'f'),
569570
help="Binary to use last band for mask True or False",
570571
)
571572
optional_named.add_argument(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def readme():
1515

1616
setuptools.setup(
1717
name="geeup",
18-
version="0.6.4",
18+
version="0.6.5",
1919
packages=find_packages(),
2020
url="https://github.com/samapriya/geeup",
2121
install_requires=[

0 commit comments

Comments
 (0)