Skip to content

Commit

Permalink
Remove pipeline references (#923)
Browse files Browse the repository at this point in the history
Cleaning up the core code, removing pipeline naming in doc strings and
documentation.
Also updated the readme generation of component to remove the pipeline
name there.
  • Loading branch information
mrchtr authored Apr 5, 2024
1 parent e87f490 commit dc7c970
Show file tree
Hide file tree
Showing 41 changed files with 229 additions and 319 deletions.
10 changes: 4 additions & 6 deletions scripts/component_readme/readme_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,16 @@ This component takes no arguments.
<a id="{{ component_id }}#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

{% if "Data loading" in tags %}
dataset = pipeline.read(
dataset = Dataset.create(
{% else %}
dataset = pipeline.read(...)
dataset = Dataset.read(...)

{% if "Data writing" not in tags %}
dataset = dataset.apply(
Expand Down
121 changes: 61 additions & 60 deletions src/fondant/cli.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/fondant/component/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def _is_previous_cached(self, input_manifest: Manifest) -> bool:
This function compares the run ID of the input manifest
(representing the previous component) with the run ID of the current component metadata.
If the run IDs are different, it indicates that the previous component's output belongs to
another pipeline run, implying that it is cached. Otherwise, if the run IDs match, it
another workflow run, implying that it is cached. Otherwise, if the run IDs match, it
suggests that the previous component was not cached and had to execute to produce the
current output.
Expand All @@ -280,7 +280,7 @@ def _is_previous_cached(self, input_manifest: Manifest) -> bool:

logger.info(
f"Previous component `{previous_component_id}` run was cached. "
f"Cached pipeline id: {input_manifest.run_id}",
f"Cached workflow id: {input_manifest.run_id}",
)
return True

Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/caption_images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ The component takes the following arguments to alter its behavior:
<a id="caption_images#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"caption_images",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/chunk_text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ The component takes the following arguments to alter its behavior:
<a id="chunk_text#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"chunk_text",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/crop_images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ The component takes the following arguments to alter its behavior:
<a id="crop_images#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"crop_images",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/download_images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ The component takes the following arguments to alter its behavior:
<a id="download_images#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"download_images",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/embed_images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ The component takes the following arguments to alter its behavior:
<a id="embed_images#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"embed_images",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/embed_text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ The component takes the following arguments to alter its behavior:
<a id="embed_text#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"embed_text",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/extract_image_resolution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ This component takes no arguments.
<a id="extract_image_resolution#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"extract_image_resolution",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/filter_image_resolution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ The component takes the following arguments to alter its behavior:
<a id="filter_image_resolution#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"filter_image_resolution",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/filter_language/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ The component takes the following arguments to alter its behavior:
<a id="filter_language#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"filter_language",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/filter_text_length/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ The component takes the following arguments to alter its behavior:
<a id="filter_text_length#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"filter_text_length",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/generate_minhash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ The component takes the following arguments to alter its behavior:
<a id="generate_minhash#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(
"generate_minhash",
Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/index_aws_opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ The component takes the following arguments to alter its behavior:
<a id="index_aws_opensearch#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(...)

Expand Down
8 changes: 3 additions & 5 deletions src/fondant/components/index_qdrant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@ The component takes the following arguments to alter its behavior:
<a id="index_qdrant#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline
from fondant.dataset import Dataset


pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(...)

Expand Down
35 changes: 7 additions & 28 deletions src/fondant/components/index_weaviate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,9 @@ To run the component with text snippets as input, the component needs to be conn

```python
import pyarrow as pa
from fondant.dataset import Pipeline
from fondant.dataset import Dataset

pipeline = Pipeline(name="my_pipeline", base_path="path/to/pipeline")

dataset = pipeline.read(
"load_from_csv",
arguments={
"dataset_uri": "path/to/dataset.csv",
},
produces={
"text": pa.string(),
}
)
dataset = Dataset.read(...)

dataset.write(
"index_weaviate",
Expand All @@ -44,19 +34,10 @@ dataset.write(

```python
import pyarrow as pa
from fondant.dataset import Pipeline
from fondant.dataset import Dataset

pipeline = Pipeline(name="my_pipeline",base_path="path/to/pipeline")

dataset = pipeline.read(
"load_from_csv",
arguments={
"dataset_uri": "path/to/dataset.csv",
},
produces={
"text": pa.string(),
}
)
dataset = Dataset.read(...)

dataset = dataset.apply(
"embed_text",
Expand Down Expand Up @@ -123,15 +104,13 @@ The component takes the following arguments to alter its behavior:
<a id="index_weaviate#usage"></a>
## Usage

You can add this component to your pipeline using the following code:
You can apply this component to your dataset using the following code:

```python
from fondant.pipeline import Pipeline

from fondant.dataset import Dataset

pipeline = Pipeline(...)

dataset = pipeline.read(...)
dataset = Dataset.read(...)

dataset = dataset.apply(...)

Expand Down
27 changes: 4 additions & 23 deletions src/fondant/components/index_weaviate/fondant_component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,9 @@ description: |
```python
import pyarrow as pa
from fondant.dataset import Pipeline
from fondant.dataset import Dataset
pipeline = Pipeline(name="my_pipeline", base_path="path/to/pipeline")
dataset = pipeline.read(
"load_from_csv",
arguments={
"dataset_uri": "path/to/dataset.csv",
},
produces={
"text": pa.string(),
}
)
dataset = Dataset.read(...)
dataset.write(
"index_weaviate",
Expand All @@ -42,19 +32,10 @@ description: |
```python
import pyarrow as pa
from fondant.dataset import Pipeline
from fondant.dataset import Dataset
pipeline = Pipeline(name="my_pipeline",base_path="path/to/pipeline")
dataset = pipeline.read(
"load_from_csv",
arguments={
"dataset_uri": "path/to/dataset.csv",
},
produces={
"text": pa.string(),
}
)
dataset = Dataset.read(...)
dataset = dataset.apply(
"embed_text",
Expand Down
Loading

0 comments on commit dc7c970

Please sign in to comment.