Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@

The EXTRACT_COLUMNS node takes an input dataframe/matrix and returns a dataframe/matrix with only the specified columns.

Inputs
------
default : DataFrame|Matrix
Input to use as the table for column extraction

Parameters
----------
columns : list of str or list of int
The columns to extract from the input dataframe.
The columns to extract from the input dataframe

Returns
-------
DataFrame | Matrix
The dataframe or matrix with only the specified columns.
DataFrame|Matrix
DataFrame or Matrix with only the specified columns
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

The OPEN_IMAGE node loads an image file from disk and returns an image type DataContainer object.

Inputs
------
default: None

Parameters
----------
file_path : str
Expand All @@ -9,3 +13,4 @@ file_path : str
Returns
-------
Image
Image loaded from specified file path
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

The OPEN_PARQUET node loads a local file of the .parquet file format. It then returns the file as a pandas.Dataframe type.

Inputs
------
default: None

Parameters
----------
file_path : str
path to the file to be loaded
File path to the .parquet file or an URL of a .parquet file.

Returns
-------
Dataframe
DataFrame
DataFrame loaded from .parquet file
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ Parameters
----------
file_path : str
File path to the .csv file or an URL of a .csv file.

Returns
-------
DataFrame
DataFrame loaded from .csv file
6 changes: 6 additions & 0 deletions docs/nodes/EXTRACTORS/FILE/READ_S3/a1-[autogen]/docstring.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

The READ_S3 node takes a S3_key name, S3 bucket name, and file name as input, and extracts the file from the specified bucket using the S3_key that was saved.

Inputs
------
default: None

Parameters
----------
s3_name : str
Expand All @@ -13,3 +17,5 @@ file_name : str
Returns
-------
DataFrame
DataFrame loaded from file in the specfied bucket

Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@ The SKLEARNIMAGE node is designed to load example images from scikit-image.

Examples can be found here:
https://scikit-image.org/docs/stable/auto_examples/index.html

Parameters
----------
img_key : str
The name of the image to be loader from scikit-image.

Outputs
-------
Image
DataContainer containing image loaded from scikit-image.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from skimage import data
from typing import Literal


@flojoy(node_type="default", deps={"scikit-image": "0.21.0"})
@flojoy(deps={"scikit-image": "0.21.0"})
def SKLEARNIMAGE(
img_key: Literal[
"astronaut",
Expand Down Expand Up @@ -52,6 +52,7 @@ def SKLEARNIMAGE(
] = "astronaut"
) -> Image:


img_array = getattr(data, img_key)()

if len(img_array.shape) == 2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def LOADER(
measurement_id: Optional[str] = None,
dc_id: Optional[str] = None,
) -> DataContainer:
api_key = get_env_var("FLOJOY_CLOUD_API_KEY")
api_key = get_env_var("FLOJOY_CLOUD_KEY")

if api_key is None:
raise KeyError("Frontier API key is not found!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ file_path : str
Returns
-------
Image|DataFrame
type 'image' for file_type 'image'
type 'dataframe' for file_type 'json', 'csv', 'excel', 'xml'
Image for file_type 'image'
DataFrame for file_type 'json', 'csv', 'excel', 'xml'
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ file_path : str

Returns
-------
Dataframe
DataFrame
DataFrame loaded from the .mat file
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from flojoy import flojoy, OrderedPair, Scalar, Vector
from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from flojoy_nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from functools import reduce


Expand All @@ -9,6 +9,7 @@ def ADD(
a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector]
) -> OrderedPair | Scalar | Vector:


initial = get_val(a)
seq = map(lambda dc: get_val(dc), b)
y = reduce(lambda u, v: np.add(u, v), seq, initial)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from flojoy import flojoy, OrderedPair, Scalar, Vector
from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from flojoy_nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from functools import reduce


Expand All @@ -9,6 +9,7 @@ def DIVIDE(
a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector]
) -> OrderedPair | Scalar | Vector:


initial = get_val(a)
seq = map(lambda dc: get_val(dc), b)
y = reduce(lambda u, v: np.divide(u, v), seq, initial)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from flojoy import OrderedPair, flojoy, Scalar, Vector
from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from flojoy_nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from functools import reduce


Expand All @@ -9,6 +9,7 @@ def MULTIPLY(
a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector]
) -> OrderedPair | Scalar | Vector:


initial = get_val(a)
seq = map(lambda dc: get_val(dc), b)
y = reduce(lambda u, v: np.multiply(u, v), seq, initial)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from flojoy import flojoy, OrderedPair, Scalar, Vector
from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from flojoy_nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val
from functools import reduce


Expand All @@ -9,6 +9,7 @@ def SUBTRACT(
a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector]
) -> OrderedPair | Scalar | Vector:


initial = get_val(a)
seq = map(lambda dc: get_val(dc), b)
y = reduce(lambda u, v: np.subtract(u, v), seq, initial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@ from flojoy import flojoy, OrderedTriple, Matrix
import numpy as np


def contains_only_numbers(column, colName):
for i in range(0, len(column)):
if not isinstance(column.item(i), (int, float)):
raise ValueError(
f"The value {column.item(i)} in column {colName} is of type {type(column.item(i))}. The OrderedTriple need to contain only int or float values."
)


@flojoy
def DOUBLE_INDEFINITE_INTEGRAL(
default: OrderedTriple, width: int = 3, height: int = 3
) -> Matrix:


def contains_only_numbers(column):
return all(isinstance(value, (np.int_, np.float_)) for value in column)

if np.divide(len(default.x), width) == height:
if not contains_only_numbers(default.x):
raise ValueError(
"There is some values that are not of type int or float. The OrderedTriple need to contain only int or float values."
)
elif not contains_only_numbers(default.y):
raise ValueError(
"There is some values that are not of type int or float. The OrderedTriple need to contain only int or float values."
)
elif not contains_only_numbers(default.z):
raise ValueError(
"There is some values that are not of type int or float. The OrderedTriple need to contain only int or float values."
)
contains_only_numbers(default.x, "x")
contains_only_numbers(default.y, "y")
contains_only_numbers(default.z, "z")

input_x = np.reshape(default.x, (height, width))
input_y = np.reshape(default.y, (height, width))
Expand Down
Loading