pixeltype.py: Add static methods for constructors without args.

PiperOrigin-RevId: 644468693
This commit is contained in:
Kurt Schwehr 2024-06-18 12:04:13 -07:00 committed by Google Earth Engine Authors
parent 74f0b0f6dd
commit 5d9e247563
2 changed files with 55 additions and 4 deletions

View File

@ -129,3 +129,57 @@ class PixelType(computedobject.ComputedObject):
"""
return apifunction.ApiFunction.call_(self.name() + '.precision', self)
@staticmethod
def double() -> 'PixelType':
"""Returns the 64-bit floating point pixel type."""
return apifunction.ApiFunction.call_('PixelType.double')
@staticmethod
def float() -> 'PixelType':
"""Returns the 32-bit floating point pixel type."""
return apifunction.ApiFunction.call_('PixelType.float')
@staticmethod
def int16() -> 'PixelType':
"""Returns the 16-bit signed integer pixel type."""
return apifunction.ApiFunction.call_('PixelType.int16')
@staticmethod
def int32() -> 'PixelType':
"""Returns the 32-bit signed integer pixel type."""
return apifunction.ApiFunction.call_('PixelType.int32')
@staticmethod
def int64() -> 'PixelType':
"""Returns the 64-bit signed integer pixel type."""
return apifunction.ApiFunction.call_('PixelType.int64')
@staticmethod
def int8() -> 'PixelType':
"""Returns the 8-bit signed integer pixel type."""
return apifunction.ApiFunction.call_('PixelType.int8')
@staticmethod
def uint16() -> 'PixelType':
"""Returns the 16-bit unsigned integer pixel type."""
return apifunction.ApiFunction.call_('PixelType.uint16')
@staticmethod
def uint32() -> 'PixelType':
"""Returns the 32-bit unsigned integer pixel type."""
return apifunction.ApiFunction.call_('PixelType.uint32')
@staticmethod
def uint8() -> 'PixelType':
"""Returns the 8-bit unsigned integer pixel type."""
return apifunction.ApiFunction.call_('PixelType.uint8')

View File

@ -1,8 +1,5 @@
#!/usr/bin/env python3
"""Tests for the ee.PixelType module.
Everything except the PixelType constructor is dynamically generated.
"""
"""Tests for the ee.PixelType module."""
import enum
import json