MCPcopy
hub / github.com/google/earthengine-api / test_add

Method test_add

python/ee/tests/kernel_test.py:83–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

81 ee.Kernel(1234) # pytype:disable=wrong-arg-types
82
83 def test_add(self):
84 kernel1 = ee.Kernel.kirsch(1.1, True)
85 kernel2 = ee.Kernel.prewitt(2.2, False)
86 normalize = True
87 expect = make_expression_graph({
88 'arguments': {
89 'kernel1': {
90 'functionInvocationValue': {
91 'functionName': 'Kernel.kirsch',
92 'arguments': {
93 'magnitude': {'constantValue': 1.1},
94 'normalize': {'constantValue': True},
95 },
96 }
97 },
98 'kernel2': {
99 'functionInvocationValue': {
100 'functionName': 'Kernel.prewitt',
101 'arguments': {
102 'magnitude': {'constantValue': 2.2},
103 'normalize': {'constantValue': False},
104 },
105 }
106 },
107 'normalize': {'constantValue': normalize},
108 },
109 'functionName': 'Kernel.add',
110 })
111 expression = kernel1.add(kernel2, normalize)
112 result = json.loads(expression.serialize())
113 self.assertEqual(expect, result)
114
115 expression = kernel1.add(kernel2=kernel2, normalize=normalize)
116 result = json.loads(expression.serialize())
117 self.assertEqual(expect, result)
118
119 def test_chebyshev(self):
120 radius = 1.1

Callers

nothing calls this directly

Calls 5

kirschMethod · 0.80
prewittMethod · 0.80
make_expression_graphFunction · 0.70
addMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected