Skip to content

Commit

Permalink
v0.1.391
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 607443197
  • Loading branch information
Google Earth Engine Authors authored and sufyanAbbasi committed Feb 21, 2024
1 parent 15eba7a commit cbf4b39
Show file tree
Hide file tree
Showing 15 changed files with 668 additions and 554 deletions.
607 changes: 305 additions & 302 deletions javascript/build/ee_api_js.js

Large diffs are not rendered by default.

241 changes: 141 additions & 100 deletions javascript/build/ee_api_js_debug.js

Large diffs are not rendered by default.

287 changes: 164 additions & 123 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.390",
"version": "0.1.391",
"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.390';
const API_CLIENT_VERSION = '0.1.391';

exports.VERSION = apiVersion.VERSION;
exports.API_CLIENT_VERSION = API_CLIENT_VERSION;
Expand Down
36 changes: 24 additions & 12 deletions javascript/src/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class ExportTask {
Export.image.toAsset = function(
image, opt_description, opt_assetId, opt_pyramidingPolicy, opt_dimensions,
opt_region, opt_scale, opt_crs, opt_crsTransform, opt_maxPixels,
opt_shardSize) {
opt_shardSize,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.image.toAsset, arguments);
const serverConfig = Export.convertToServerParams(
Expand Down Expand Up @@ -164,7 +165,8 @@ Export.image.toCloudStorage = function(
image, opt_description, opt_bucket, opt_fileNamePrefix, opt_dimensions,
opt_region, opt_scale, opt_crs, opt_crsTransform, opt_maxPixels,
opt_shardSize, opt_fileDimensions, opt_skipEmptyTiles, opt_fileFormat,
opt_formatOptions) {
opt_formatOptions,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.image.toCloudStorage, arguments);
const serverConfig = Export.convertToServerParams(
Expand Down Expand Up @@ -196,7 +198,8 @@ Export.image.toDrive = function(
image, opt_description, opt_folder, opt_fileNamePrefix, opt_dimensions,
opt_region, opt_scale, opt_crs, opt_crsTransform, opt_maxPixels,
opt_shardSize, opt_fileDimensions, opt_skipEmptyTiles, opt_fileFormat,
opt_formatOptions) {
opt_formatOptions,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.image.toDrive, arguments);
const serverConfig = Export.convertToServerParams(
Expand Down Expand Up @@ -225,7 +228,8 @@ Export.image.toDrive = function(
Export.map.toCloudStorage = function(
image, opt_description, opt_bucket, opt_fileFormat, opt_path,
opt_writePublicTiles, opt_scale, opt_maxZoom, opt_minZoom, opt_region,
opt_skipEmptyTiles, opt_mapsApiKey, opt_bucketCorsUris) {
opt_skipEmptyTiles, opt_mapsApiKey, opt_bucketCorsUris,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.map.toCloudStorage, arguments);
const serverConfig = Export.convertToServerParams(
Expand All @@ -247,7 +251,8 @@ Export.map.toCloudStorage = function(
*/
Export.table.toCloudStorage = function(
collection, opt_description, opt_bucket, opt_fileNamePrefix, opt_fileFormat,
opt_selectors, opt_maxVertices) {
opt_selectors, opt_maxVertices,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.table.toCloudStorage, arguments);
const serverConfig = Export.convertToServerParams(
Expand All @@ -269,7 +274,8 @@ Export.table.toCloudStorage = function(
*/
Export.table.toDrive = function(
collection, opt_description, opt_folder, opt_fileNamePrefix, opt_fileFormat,
opt_selectors, opt_maxVertices) {
opt_selectors, opt_maxVertices,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.table.toDrive, arguments);
clientConfig['type'] = ExportType.TABLE;
Expand All @@ -288,7 +294,8 @@ Export.table.toDrive = function(
* @export
*/
Export.table.toAsset = function(
collection, opt_description, opt_assetId, opt_maxVertices) {
collection, opt_description, opt_assetId, opt_maxVertices,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.table.toAsset, arguments);
const serverConfig = Export.convertToServerParams(
Expand All @@ -310,7 +317,8 @@ Export.table.toAsset = function(
*/
Export.table.toFeatureView = function(
collection, opt_description, opt_assetId, opt_maxFeaturesPerTile,
opt_thinningStrategy, opt_thinningRanking, opt_zOrderRanking) {
opt_thinningStrategy, opt_thinningRanking, opt_zOrderRanking,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.table.toFeatureView, arguments);
const serverConfig = Export.convertToServerParams(
Expand All @@ -332,7 +340,8 @@ Export.table.toFeatureView = function(
*/
Export.table.toBigQuery = function(
collection, opt_description, opt_table, opt_overwrite, opt_append,
opt_selectors, opt_maxVertices) {
opt_selectors, opt_maxVertices,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.table.toBigQuery, arguments);
const serverConfig = Export.convertToServerParams(
Expand Down Expand Up @@ -360,7 +369,8 @@ Export.table.toBigQuery = function(
Export.video.toCloudStorage = function(
collection, opt_description, opt_bucket, opt_fileNamePrefix,
opt_framesPerSecond, opt_dimensions, opt_region, opt_scale, opt_crs,
opt_crsTransform, opt_maxPixels, opt_maxFrames) {
opt_crsTransform, opt_maxPixels, opt_maxFrames,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.video.toCloudStorage, arguments);
const serverConfig = Export.convertToServerParams(
Expand Down Expand Up @@ -388,7 +398,8 @@ Export.video.toCloudStorage = function(
Export.video.toDrive = function(
collection, opt_description, opt_folder, opt_fileNamePrefix,
opt_framesPerSecond, opt_dimensions, opt_region, opt_scale, opt_crs,
opt_crsTransform, opt_maxPixels, opt_maxFrames) {
opt_crsTransform, opt_maxPixels, opt_maxFrames,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.video.toDrive, arguments);
const serverConfig = Export.convertToServerParams(
Expand All @@ -403,7 +414,8 @@ Export.video.toDrive = function(
* @return {!ExportTask}
* @export
*/
Export.classifier.toAsset = function(classifier, opt_description, opt_assetId) {
Export.classifier.toAsset = function(classifier, opt_description, opt_assetId,
) {
const clientConfig =
eeArguments.extractFromFunction(Export.classifier.toAsset, arguments);
const serverConfig = Export.convertToServerParams(
Expand Down
8 changes: 8 additions & 0 deletions javascript/src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3494,6 +3494,7 @@ ee.data.AbstractTaskConfig;
* assetId: (undefined|string),
* pyramidingPolicy: (undefined|string),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.ImageTaskConfigUnformatted;
Expand Down Expand Up @@ -3538,6 +3539,7 @@ ee.data.ImageTaskConfigUnformatted;
* assetId: (undefined|string),
* pyramidingPolicy: (undefined|string),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.ImageTaskConfig;
Expand Down Expand Up @@ -3589,6 +3591,7 @@ ee.data.ImageExportFormatConfig;
* mapsApiKey: (undefined|string),
* generateEarthHtml: (undefined|boolean),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.MapTaskConfig;
Expand All @@ -3606,6 +3609,7 @@ ee.data.MapTaskConfig;
* assetId: (undefined|string),
* maxWorkers: (undefined|number),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.ClassifierTaskConfig;
Expand All @@ -3627,6 +3631,7 @@ ee.data.ClassifierTaskConfig;
* thinningRanking: (undefined|string|!Array<string>),
* zOrderRanking: (undefined|string|!Array<string>),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.FeatureViewTaskConfig;
Expand All @@ -3647,6 +3652,7 @@ ee.data.FeatureViewTaskConfig;
* maxWorkers: (undefined|number),
* maxVertices: (undefined|number),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.BigQueryTaskConfig;
Expand All @@ -3671,6 +3677,7 @@ ee.data.BigQueryTaskConfig;
* maxWorkers: (undefined|number),
* maxVertices: (undefined|number),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.TableTaskConfig;
Expand Down Expand Up @@ -3699,6 +3706,7 @@ ee.data.TableTaskConfig;
* outputBucket: (undefined|string),
* outputPrefix: (undefined|string),
* workloadTag: (undefined|string),
* priority: (undefined|number),
* }}
*/
ee.data.VideoTaskConfig;
Expand Down
15 changes: 7 additions & 8 deletions javascript/src/eeapiclient/domain_object.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/**
* g3-format-changed-lines-during-prettier-version-upgrade
* Utility map for ClassMetadata to describe how to create instances of child
* properties.
*/
Expand Down Expand Up @@ -27,13 +26,13 @@ type Primitive = string | number | boolean | null | undefined;
export type DeepPartialISerializable<T> = T extends Primitive
? Partial<T>
: T extends ISerializable
? Omit<
{[K in keyof T]?: DeepPartialISerializable<T[K]>},
keyof ISerializable | 'getPartialClassMetadata'
>
: T extends object
? {[K in keyof T]?: DeepPartialISerializable<T[K]>}
: unknown;
? Omit<
{[K in keyof T]?: DeepPartialISerializable<T[K]>},
keyof ISerializable | 'getPartialClassMetadata'
>
: T extends object
? {[K in keyof T]?: DeepPartialISerializable<T[K]>}
: unknown;

/**
* Description of the properties in a Serializable class.
Expand Down
6 changes: 4 additions & 2 deletions javascript/src/eeapiclient/multipart_request.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// g3-format-changed-lines-during-prettier-version-upgrade
import {Serializable, serialize} from './domain_object';

export class MultipartRequest {
private _boundary: string;
private _metadataPayload = '';
private _payloadPromise: Promise<string>;

constructor(private files: File[], private _metadata?: {} | null) {
constructor(
private files: File[],
private _metadata?: {} | null,
) {
this._boundary = Date.now().toString();
if (_metadata) {
this.addMetadata(_metadata);
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.390'
__version__ = '0.1.391'

# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
Expand Down
4 changes: 3 additions & 1 deletion python/ee/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,12 +1191,14 @@ def run(
eecu = '{:.4f}'.format(
task['batch_eecu_usage_seconds']
) if 'batch_eecu_usage_seconds' in task else '-'
trailing_extras = task.get('destination_uris', [])
extra = ' {:20s} {:20s} {:20s} {:11s} {}'.format(
show_date(task['creation_timestamp_ms']),
show_date(task['start_timestamp_ms']),
show_date(task['update_timestamp_ms']),
eecu,
' '.join(task.get('destination_uris', [])))
' '.join(map(str, trailing_extras)),
)
print(format_str.format(
task['id'], task_type, truncated_desc,
task['state'], task.get('error_message', '---')) + extra)
Expand Down
2 changes: 1 addition & 1 deletion python/ee/deprecation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Decorators to mark function deprecated."""
"""Decorators to handle various deprecations."""

import functools
import warnings
Expand Down
6 changes: 5 additions & 1 deletion python/ee/terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ def __init__(self):
def initialize(cls) -> None:
"""Imports API functions to this class."""
if not cls._initialized:
apifunction.ApiFunction.importApi(cls, 'Terrain', 'Terrain')
apifunction.ApiFunction.importApi(cls, cls.__name__, cls.__name__)
cls._initialized = True

@classmethod
def reset(cls) -> None:
"""Removes imported API functions from this class."""
apifunction.ApiFunction.clearApi(cls)
cls._initialized = False

@staticmethod
def name() -> str:
return 'Terrain'
2 changes: 2 additions & 0 deletions python/ee/tests/deprecation_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env python3
"""Tests for the ee.deprecation module."""
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "earthengine-api"
version = "0.1.390"
version = "0.1.391"
description = "Earth Engine Python API"
requires-python = ">=3.7"
keywords = [
Expand Down

0 comments on commit cbf4b39

Please sign in to comment.