Skip to content

Commit

Permalink
v0.1.402
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 630164461
  • Loading branch information
Google Earth Engine Authors authored and naschmitz committed May 9, 2024
1 parent 651fb11 commit 5322d7c
Show file tree
Hide file tree
Showing 20 changed files with 2,271 additions and 1,076 deletions.
2 changes: 1 addition & 1 deletion demos/interactive-classifier/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get(self):
)

# Train a classifier using the aggregated data.
classifier = ee.Classifier.naiveBayes().train(
classifier = ee.Classifier.smileNaiveBayes().train(
features=training,
classProperty='label',
inputProperties=landsat_composite.bandNames(),
Expand Down
1,318 changes: 658 additions & 660 deletions javascript/build/ee_api_js.js

Large diffs are not rendered by default.

290 changes: 122 additions & 168 deletions javascript/build/ee_api_js_debug.js

Large diffs are not rendered by default.

334 changes: 144 additions & 190 deletions javascript/build/ee_api_js_npm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@google/earthengine",
"version": "0.1.401",
"version": "0.1.402",
"description": "JavaScript client for Google Earth Engine API.",
"author": "Google LLC",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/apiclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const {trustedResourceUrl} = goog.require('safevalues');
/** @namespace */
const apiclient = {};

const API_CLIENT_VERSION = '0.1.401';
const API_CLIENT_VERSION = '0.1.402';

exports.VERSION = apiVersion.VERSION;
exports.API_CLIENT_VERSION = API_CLIENT_VERSION;
Expand Down
28 changes: 11 additions & 17 deletions javascript/src/geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) {
// argument, we know the arguments were passed in sequence. If not, we
// assume the user intended to pass a named argument dictionary and use
// ee.arguments.extractFromFunction() to validate and extract the keys.
if (!('type' in geoJson)) {
var args = ee.arguments.extractFromFunction(ee.Geometry, arguments);
if (typeof geoJson !== 'object' || !('type' in geoJson)) {
const args = ee.arguments.extractFromFunction(ee.Geometry, arguments);
geoJson = args['geoJson'];
opt_proj = args['proj'];
opt_geodesic = args['geodesic'];
Expand All @@ -77,9 +77,9 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) {

ee.Geometry.initialize();

var computed = geoJson instanceof ee.ComputedObject &&
const computed = geoJson instanceof ee.ComputedObject &&
!(geoJson instanceof ee.Geometry && geoJson.type_);
var options =
const options =
(opt_proj != null || opt_geodesic != null || opt_evenOdd != null);
if (computed) {
if (options) {
Expand All @@ -94,7 +94,7 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) {

// Below here, we're working with a GeoJSON literal.
if (geoJson instanceof ee.Geometry) {
geoJson = /** @type {Object} */(geoJson.encode());
geoJson = /** @type {!Object} */(geoJson.encode());
}

if (!ee.Geometry.isValidGeometry_(geoJson)) {
Expand All @@ -105,32 +105,28 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) {

/**
* The type of the geometry.
* @type {string}
* @private
* @private @const {string}
*/
this.type_ = geoJson['type'];

/**
* The coordinates of the geometry, up to 4 nested levels with numbers at
* the last level. Null if and only if type is GeometryCollection.
* @type {Array?}
* @private
* @private @const {?Array}
*/
this.coordinates_ = (geoJson['coordinates'] != null) ?
goog.object.unsafeClone(geoJson['coordinates']) :
null;

/**
* The subgeometries, non-null if and only if type is GeometryCollection.
* @type {Array?}
* @private
* @private @const {Array?}
*/
this.geometries_ = geoJson['geometries'] || null;

/**
* The projection of the geometry.
* @type {String|undefined}
* @private
* @private {string|undefined}
*/
this.proj_;
if (opt_proj != null) {
Expand All @@ -148,8 +144,7 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) {

/**
* Whether the geometry has spherical geodesic edges.
* @type {boolean|undefined}
* @private
* @private {boolean|undefined}
*/
this.geodesic_ = opt_geodesic;
if (this.geodesic_ === undefined && 'geodesic' in geoJson) {
Expand All @@ -159,8 +154,7 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) {
/**
* Whether polygon interiors are based on the even/odd rule. If false,
* the left-inside rule is used. If unspecified, defaults to true.
* @type {boolean|undefined}
* @private
* @private {boolean|undefined}
*/
this.evenOdd_ = opt_evenOdd;
if (this.evenOdd_ === undefined && 'evenOdd' in geoJson) {
Expand Down
12 changes: 10 additions & 2 deletions javascript/src/layers/abstractoverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ ee.layers.AbstractOverlay = class extends goog.events.EventTarget {
return this.stats;
}

/** @override */
/**
* Implements getTile() for the google.maps.MapType interface.
* @param {?google.maps.Point} coord Position of tile.
* @param {number} zoom Zoom level.
* @param {?Document} ownerDocument Parent document.
* @return {?Element} Element to be displayed as a map tile.
*/
getTile(coord, zoom, ownerDocument) {
var maxCoord = 1 << zoom;

Expand Down Expand Up @@ -193,7 +199,9 @@ ee.layers.AbstractOverlay = class extends goog.events.EventTarget {
return tile.div;
}

/** @override */
/**
* Implements releaseTile() for the google.maps.MapType interface.
*/
releaseTile(tileDiv) {
var tile = this.tilesById.get(tileDiv.id);
this.tilesById.remove(tileDiv.id);
Expand Down
2 changes: 1 addition & 1 deletion python/ee/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The EE Python library."""

__version__ = '0.1.401'
__version__ = '0.1.402'

# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
Expand Down
2 changes: 1 addition & 1 deletion python/ee/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import contextlib
import json
import sys
from typing import Any, Callable, Dict, Iterator, Optional, TextIO, Union
from typing import Any, Dict, Iterator, Optional, TextIO, Union

from google.auth import crypt
from google.oauth2 import service_account
Expand Down
4 changes: 2 additions & 2 deletions python/ee/apitestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _MockThumbUrl(
self,
params: Dict[str, Any],
# pylint: disable-next=invalid-name
thumbType: str = None,
thumbType: Optional[str] = None,
) -> Dict[str, str]:
del thumbType # Unused.
# Hang on to the call arguments.
Expand Down Expand Up @@ -113,7 +113,7 @@ def _GenerateCloudApiResource(mock_http: Any, raw: Any) -> discovery.Resource:
)


@contextlib.contextmanager
@contextlib.contextmanager # pytype: disable=wrong-arg-types
def UsingCloudApi(
cloud_api_resource: Optional[Any] = None,
cloud_api_resource_raw: Optional[Any] = None,
Expand Down
2 changes: 1 addition & 1 deletion python/ee/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# TODO: Make a better type for a list of keys.
_EeKeyListType = _EeAnyType
_IntegerType = Union[int, ee_number.Number, computedobject.ComputedObject]
_StringType = Union[str, ee_string.String, computedobject.ComputedObject]
_StringType = Union[str, 'ee_string.String', computedobject.ComputedObject]
# TODO: Make a better type for a list of strings.
# Or is this the same as _EeKeyListType?
_StringListType = Union[Any, computedobject.ComputedObject]
Expand Down
Loading

0 comments on commit 5322d7c

Please sign in to comment.