MCPcopy Index your code
hub / github.com/google/earthengine-api / test_accum

Method test_accum

python/ee/tests/ee_array_test.py:177–197  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

175 self.assertEqual(expect, result)
176
177 def test_accum(self):
178 expect = make_expression_graph({
179 'arguments': {
180 'array': ARRAY_ONE,
181 'axis': {'constantValue': 2},
182 'reducer': {
183 'functionInvocationValue': {
184 'functionName': 'Reducer.sum',
185 'arguments': {},
186 }
187 },
188 },
189 'functionName': 'Array.accum',
190 })
191 expression = ee.Array([1]).accum(2, ee.Reducer.sum())
192 result = json.loads(expression.serialize())
193 self.assertEqual(expect, result)
194
195 expression = ee.Array([1]).accum(axis=2, reducer=ee.Reducer.sum())
196 result = json.loads(expression.serialize())
197 self.assertEqual(expect, result)
198
199 def test_acos(self):
200 expect = make_expression_graph({

Callers

nothing calls this directly

Calls 4

accumMethod · 0.80
make_expression_graphFunction · 0.70
sumMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected