pgzmnk commited on
Commit
8c07762
1 Parent(s): 18401ba

Introduce indices array as instance param.

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. utils/indicators.py +2 -0
app.py CHANGED
@@ -5,7 +5,7 @@ from utils.gradio import get_window_url_params
5
  from utils.indicators import IndexGenerator
6
 
7
  # Instantiate outside gradio app to avoid re-initializing GEE, which is slow
8
- indexgenerator = IndexGenerator()
9
 
10
  with gr.Blocks() as demo:
11
  with gr.Column():
 
5
  from utils.indicators import IndexGenerator
6
 
7
  # Instantiate outside gradio app to avoid re-initializing GEE, which is slow
8
+ indexgenerator = IndexGenerator(indices=['NDWI','Water','Protected','Air'])
9
 
10
  with gr.Blocks() as demo:
11
  with gr.Column():
utils/indicators.py CHANGED
@@ -27,12 +27,14 @@ class IndexGenerator:
27
 
28
  def __init__(
29
  self,
 
30
  ):
31
  # Authenticate to GEE & DuckDB
32
  self._authenticate_ee(GEE_SERVICE_ACCOUNT)
33
 
34
  # Set instance variables
35
  self.indices = self._load_indices(INDICES_FILE)
 
36
 
37
 
38
  def _cloudfree(self, gee_path, daterange):
 
27
 
28
  def __init__(
29
  self,
30
+ indices,
31
  ):
32
  # Authenticate to GEE & DuckDB
33
  self._authenticate_ee(GEE_SERVICE_ACCOUNT)
34
 
35
  # Set instance variables
36
  self.indices = self._load_indices(INDICES_FILE)
37
+ breakpoint()
38
 
39
 
40
  def _cloudfree(self, gee_path, daterange):