Skip to content
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ into the correct format for the Timelapse Feature Explorer.
```python
import pandas as pd
from io import StringIO
from tfe_data import convert_colorizer_data
from tfe_data import convert_tfe_data

from pathlib import Path

Expand All @@ -49,7 +49,7 @@ source_dir = Path("some/source/directory")
data: pd.DataFrame = pd.read_csv(StringIO(csv))
output_dir = Path("some/directory/my-dataset")

convert_colorizer_data(
convert_tfe_data(
data,
output_dir,
source_dir=source_dir,
Expand Down
4 changes: 2 additions & 2 deletions documentation/DATA_FORMAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ A collection file can also include optional metadata fields, saved under the `me
Once you get the first frame in your dataset, you'll need to save the `starting_timepoint` to your dataset's metadata and include the information when generating the frame paths.

```python
writer = ColorizerDatasetWriter(...)
writer = TfeDatasetWriter(...)
starting_timepoint = 5
num_frames = 100

Expand All @@ -841,6 +841,6 @@ frame_paths = generate_frame_paths(num_frames, start_frame=starting_timepoint)
writer.set_frame_paths(frame_paths)

# Including starting frame number in the metadata
metadata = ColorizerMetadata(start_frame_num=starting_timepoint)
metadata = DatasetMetadata(start_frame_num=starting_timepoint)
writer.write_manifest(metadata)
```
22 changes: 22 additions & 0 deletions documentation/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Migration

## From v1 to v2

1. Update imports to reflect the new package name and repository location:

```
# pip
pip install git+https://github.com/AllenCell/tfe-data.git@v2.0.0

# requirements.txt
tfe_data @ git+https://github.com/AllenCell/tfe-data.git@v2.0.0
```

2. Rename the package in any imports from `colorizer_data` to `tfe_data`.

3. Replace renamed methods and classes. The old methods/classes will continue to
work, but are marked as deprecated and will be removed in the next major
version.
- Replace `convert_colorizer_data()` with `convert_tfe_data()`.
- Replace `ColorizerMetadata` with `DatasetMetadata`.
- Replace `ColorizerDatasetWriter` with `TfeDatasetWriter`.
4 changes: 2 additions & 2 deletions documentation/bin/example_scripts/check_conversion_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pathlib
import pandas as pd
from tfe_data import convert_colorizer_data
from tfe_data import convert_tfe_data

"""
To test, run the following commands from the root directory.
Expand All @@ -14,7 +14,7 @@
source_dir = pathlib.Path("./documentation/getting_started_guide/raw_dataset")
data = pd.read_csv(source_dir / "data.csv")
output_dir = pathlib.Path("./documentation/getting_started_guide/processed_data")
convert_colorizer_data(
convert_tfe_data(
data,
output_dir,
source_dir=source_dir,
Expand Down
8 changes: 4 additions & 4 deletions documentation/bin/example_scripts/getting_started_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
from pathlib import Path

from tfe_data import (
convert_colorizer_data,
convert_tfe_data,
FeatureInfo,
FeatureType,
ColorizerMetadata,
DatasetMetadata,
CollectionMetadata,
update_collection,
)
Expand Down Expand Up @@ -90,7 +90,7 @@ def main():
dataset_out_dir.mkdir(parents=True, exist_ok=True)

# Dataset metadata
metadata = ColorizerMetadata(
metadata = DatasetMetadata(
name="Example dataset {}".format(i + 1),
description="An example dataset for the Timelapse Feature Explorer.",
author="Author name et al.",
Expand All @@ -107,7 +107,7 @@ def main():

# Convert the dataset
data: pd.DataFrame = pd.read_csv(dataset_src_dir / "data.csv")
convert_colorizer_data(
convert_tfe_data(
data,
dataset_out_dir,
source_dir=dataset_src_dir,
Expand Down
24 changes: 12 additions & 12 deletions documentation/getting_started_guide/GETTING_STARTED.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"source": [
"from pathlib import Path\n",
"\n",
"from tfe_data import convert_colorizer_data\n",
"from tfe_data import convert_tfe_data\n",
"import pandas as pd\n",
"\n",
"source_directory = Path(\"raw_datasets/dataset_1\")\n",
Expand All @@ -171,12 +171,12 @@
"# Load the dataset\n",
"data: pd.DataFrame = pd.read_csv(source_directory / \"data.csv\")\n",
"\n",
"# `convert_colorizer_data` is a helper function for dataset conversion! You can pass in a pandas DataFrame\n",
"# `convert_tfe_data` is a helper function for dataset conversion! You can pass in a pandas DataFrame\n",
"# and the output directory, as well as the names of the data columns for the id, time, track, and image data.\n",
"# Any other columns are treated as features. We'll show off more advanced behavior in later steps, but this will\n",
"# output a complete readable dataset.\n",
"\n",
"convert_colorizer_data(\n",
"convert_tfe_data(\n",
" data,\n",
" output_directory,\n",
" source_dir=source_directory,\n",
Expand Down Expand Up @@ -206,7 +206,7 @@
"\n",
"By default, any columns that aren't mapped to data columns (e.g. object ID, times, tracks, etc.) are automatically handled as feature data. You can specify which columns are features by passing a list of column names to the `feature_columns` parameter.\n",
"\n",
"While `convert_colorizer_data` will infer feature types for you, you can also provide metadata about each feature, such as its label, key, type, units, and description using the `feature_info` argument.\n",
"While `convert_tfe_data` will infer feature types for you, you can also provide metadata about each feature, such as its label, key, type, units, and description using the `feature_info` argument.\n",
"\n",
"Features can be one of three types:\n",
"\n",
Expand Down Expand Up @@ -262,7 +262,7 @@
"# Providing it is optional, and `feature_info` will still update metadata without it.\n",
"feature_column_names = [\"area\", \"radius\", \"location\"]\n",
"\n",
"convert_colorizer_data(\n",
"convert_tfe_data(\n",
" data,\n",
" output_directory,\n",
" source_dir=source_directory,\n",
Expand Down Expand Up @@ -293,11 +293,11 @@
"outputs": [],
"source": [
"from tfe_data import (\n",
" ColorizerMetadata,\n",
" DatasetMetadata,\n",
")\n",
"\n",
"# Define the metadata for this dataset.\n",
"metadata = ColorizerMetadata(\n",
"metadata = DatasetMetadata(\n",
" name=\"Example dataset 1\",\n",
" description=\"An example dataset for the Timelapse Feature Explorer!\",\n",
" author=\"Jane Doe et al.\",\n",
Expand All @@ -311,7 +311,7 @@
" frame_duration_sec=1,\n",
")\n",
"\n",
"convert_colorizer_data(\n",
"convert_tfe_data(\n",
" data,\n",
" output_directory,\n",
" source_dir=source_directory,\n",
Expand Down Expand Up @@ -359,7 +359,7 @@
"output_directory = Path(\"processed_dataset/dataset_2\")\n",
"data: pd.DataFrame = pd.read_csv(source_directory / \"data.csv\")\n",
"\n",
"convert_colorizer_data(\n",
"convert_tfe_data(\n",
" data,\n",
" output_directory,\n",
" source_dir=source_directory,\n",
Expand Down Expand Up @@ -501,7 +501,7 @@
"# If the download doesn't start (can be browser-dependent), you can manually\n",
"# navigate to and download the zip file from the file browser on the left side\n",
"# of the screen. It will be in\n",
"# `tfe-data/documentation/getting_started_guide/`."
"# `tfe_data/documentation/getting_started_guide/`."
]
},
{
Expand Down Expand Up @@ -587,7 +587,7 @@
"For example, for 3D data, you can specify a 3D frame source like this:\n",
"\n",
"```python\n",
"from tfe_data import convert_colorizer_data\n",
"from tfe_data import convert_tfe_data\n",
"from tfe_data.types import Frames3dMetadata, Backdrop3dMetadata\n",
"\n",
"frames_3d = Frames3dMetadata(\n",
Expand Down Expand Up @@ -620,7 +620,7 @@
" ]\n",
")\n",
"\n",
"convert_colorizer_data(\n",
"convert_tfe_data(\n",
" ...\n",
" frames_3d=frames_3d,\n",
" image_column=None, # Disable 2D frame generation\n",
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ dependencies = [
"pandas",
"pillow",
"pyarrow",
"scikit-image",
"requests",
"scikit-image",
"typing-extensions",
]

[project.optional-dependencies]
Expand Down
Loading
Loading