Skip to content

Commit

Permalink
Merge pull request #136 from wri/master
Browse files Browse the repository at this point in the history
Merge down index of None hotfix
  • Loading branch information
dmannarino authored Oct 16, 2023
2 parents e4e4e2a + 41c481e commit b79bafb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
7 changes: 6 additions & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ COPY . $WORKDIR
# installing dependencies to build package
RUN pip install . -t python

# change 31337.1
# This next line needs to be changed (just increment the number) in order
# to change the hash of the file and get TF to realize it needs to be
# redeployed. Ticket for a better solution:
# https://gfw.atlassian.net/browse/GTC-1250
# change 1

RUN yum install -y zip geos-devel

# Precompile all python packages and remove .py files
Expand Down
18 changes: 7 additions & 11 deletions src/datapump/jobs/geotrellis.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@


class GeotrellisAnalysis(str, Enum):
"""
Supported analyses to run on datasets
"""
"""Supported analyses to run on datasets."""

tcl = "annualupdate_minimal"
glad = "gladalerts"
Expand Down Expand Up @@ -542,7 +540,7 @@ def _get_indices_and_cluster(
# memory limits of our DB instance. Disable for now since after
# a month the clustering won't even matter anymore.
cluster = None # Index(index_type="gist", column_names=["geom_wm"])
indices += [Index(index_type="gist", column_names=["geom"]), cluster]
indices.append(Index(index_type="gist", column_names=["geom"]))
elif (
self.table.analysis == Analysis.integrated_alerts
and analysis_agg == "daily_alerts"
Expand Down Expand Up @@ -655,14 +653,12 @@ def _get_field_type(self, field, is_whitelist=False):
return "text"

def _calculate_worker_count(self, limiting_src) -> int:
"""
Calculate a heuristic for number of workers appropriate for job based
on the size of the input features.
"""Calculate a heuristic for number of workers appropriate for job
based on the size of the input features.
Uses global constant WORKER_COUNT_PER_GB_FEATURES to determine number
of worker per GB of features.
Uses global constant WORKER_COUNT_MIN to determine minimum number of
workers.
Uses global constant WORKER_COUNT_PER_GB_FEATURES to determine
number of worker per GB of features. Uses global constant
WORKER_COUNT_MIN to determine minimum number of workers.
Multiplies by weights for specific analyses.
Expand Down

0 comments on commit b79bafb

Please sign in to comment.