Skip to content

Commit 1816465

Browse files
committed
format
1 parent ac5885b commit 1816465

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

daft/expressions/expressions.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5231,45 +5231,45 @@ def attribute(self, name: Literal["width", "height", "channel", "mode"] | ImageP
52315231
f = native.get_function_from_registry("image_attribute")
52325232
return Expression._from_pyexpr(f(self._expr, lit(name)._expr))
52335233

5234-
def width(self) -> "Expression":
5235-
"""Gets the width of an image in pixels.
5236-
5237-
Example:
5238-
>>> # Create a dataframe with an image column
5239-
>>> df = ... # doctest: +SKIP
5240-
>>> df = df.with_column("width", df["images"].image.width()) # doctest: +SKIP
5241-
"""
5242-
return self.attribute("width")
5243-
5244-
def height(self) -> "Expression":
5245-
"""Gets the height of an image in pixels.
5246-
5247-
Example:
5248-
>>> # Create a dataframe with an image column
5249-
>>> df = ... # doctest: +SKIP
5250-
>>> df = df.with_column("height", df["images"].image.height()) # doctest: +SKIP
5251-
"""
5252-
return self.attribute("height")
5253-
5254-
def channel(self) -> "Expression":
5255-
"""Gets the number of channels in an image.
5256-
5257-
Example:
5258-
>>> # Create a dataframe with an image column
5259-
>>> df = ... # doctest: +SKIP
5260-
>>> df = df.with_column("channel", df["images"].image.channel()) # doctest: +SKIP
5261-
"""
5262-
return self.attribute("channel")
5263-
5264-
def mode(self) -> "Expression":
5265-
"""Gets the mode of an image as a string.
5266-
5267-
Example:
5268-
>>> # Create a dataframe with an image column
5269-
>>> df = ... # doctest: +SKIP
5270-
>>> df = df.with_column("mode", df["images"].image.mode()) # doctest: +SKIP
5271-
"""
5272-
return self.attribute("mode")
5234+
def width(self) -> Expression:
5235+
"""Gets the width of an image in pixels.
5236+
5237+
Example:
5238+
>>> # Create a dataframe with an image column
5239+
>>> df = ... # doctest: +SKIP
5240+
>>> df = df.with_column("width", df["images"].image.width()) # doctest: +SKIP
5241+
"""
5242+
return self.attribute("width")
5243+
5244+
def height(self) -> Expression:
5245+
"""Gets the height of an image in pixels.
5246+
5247+
Example:
5248+
>>> # Create a dataframe with an image column
5249+
>>> df = ... # doctest: +SKIP
5250+
>>> df = df.with_column("height", df["images"].image.height()) # doctest: +SKIP
5251+
"""
5252+
return self.attribute("height")
5253+
5254+
def channel(self) -> Expression:
5255+
"""Gets the number of channels in an image.
5256+
5257+
Example:
5258+
>>> # Create a dataframe with an image column
5259+
>>> df = ... # doctest: +SKIP
5260+
>>> df = df.with_column("channel", df["images"].image.channel()) # doctest: +SKIP
5261+
"""
5262+
return self.attribute("channel")
5263+
5264+
def mode(self) -> Expression:
5265+
"""Gets the mode of an image as a string.
5266+
5267+
Example:
5268+
>>> # Create a dataframe with an image column
5269+
>>> df = ... # doctest: +SKIP
5270+
>>> df = df.with_column("mode", df["images"].image.mode()) # doctest: +SKIP
5271+
"""
5272+
return self.attribute("mode")
52735273

52745274

52755275
class ExpressionPartitioningNamespace(ExpressionNamespace):

0 commit comments

Comments
 (0)