Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix output_path bug and update output_path docstrings #178

Merged
merged 4 commits into from
Dec 1, 2023
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
2 changes: 1 addition & 1 deletion src/nyx/python/new_bindings_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ py::tuple featurize_fname_lists_imp (const py::list& int_fnames, const py::list
theEnvironment.n_reduce_threads,
min_online_roi_size,
theEnvironment.saveOption,
theEnvironment.output_dir);
output_path);


if (errorCode)
Expand Down
52 changes: 26 additions & 26 deletions src/nyx/python/nyxus/nyxus.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
from .nyxus_arrow import arrow_headers_found

if (arrow_headers_found()):
from .nyxus_arrow import link_arrow_lib

link_arrow_lib()

from .backend import (
initialize_environment,
featurize_directory_imp,
Expand All @@ -21,6 +14,8 @@
set_environment_params_imp,
get_params_imp,
arrow_is_enabled_imp,
get_arrow_file_imp,
get_parquet_file_imp,
)

import os
Expand All @@ -29,13 +24,6 @@
import pandas as pd
from typing import Optional, List

if (arrow_headers_found() and arrow_is_enabled_imp()):

from .backend import (
get_arrow_file_imp,
get_parquet_file_imp,
)

class Nyxus:
"""Nyxus image feature extraction library

Expand Down Expand Up @@ -249,10 +237,14 @@ def featurize_directory(
`intensity_dir` and `label_dir`
output_type: str (optional, default "pandas")
Output format for the features values. Valid options are "pandas", "arrowipc", and "parquet".
output_directory: str (optional, default "")
Output directory for Arrow IPC and Parquet output formats. Default is "", which is the current directory.
output_filename: str (optional, default "NyxusFeatures")
Output filename for Arrow IPC and Parquet output formats.
output_path: str (optional, default "")
Output filepath for Arrow IPC and Parquet output formats. Default is "", which is the current directory.
The output_path can either be to a directory or filename. For example,
- If 'output_path=/path/to/directory' then a file with the default name NyxusFeatures.<extension> will be created.
If the directory does not exist, it will be created.
- If 'output_path=/path/to/directory/some_file_name.arrow' then this file will be created.
If the directory does not exist, it will also be created.
- If 'output_path=some_file_name.arrow' then this file will be created in the current working directory.

Returns
-------
Expand Down Expand Up @@ -334,10 +326,14 @@ def featurize(
names for the labels in for the DataFrame output.
output_type: str (optional, default "pandas")
Output format for the features values. Valid options are "pandas", "arrowipc", and "parquet".
output_directory: str (optional, default "")
Output directory for Arrow IPC and Parquet output formats. Default is "", which is the current directory.
output_filename: str (optional, default "NyxusFeatures")
Output filename for Arrow IPC and Parquet output formats.
output_path: str (optional, default "")
Output filepath for Arrow IPC and Parquet output formats. Default is "", which is the current directory.
The output_path can either be to a directory or filename. For example,
- If 'output_path=/path/to/directory' then a file with the default name NyxusFeatures.<extension> will be created.
If the directory does not exist, it will be created.
- If 'output_path=/path/to/directory/some_file_name.arrow' then this file will be created.
If the directory does not exist, it will also be created.
- If 'output_path=some_file_name.arrow' then this file will be created in the current working directory.

Returns
-------
Expand Down Expand Up @@ -458,10 +454,14 @@ def featurize_files (
single_roi : 'True' to treat items of 'intensity_files' as single-ROI ('mask_files' will be ignored), 'False' to treat items of 'intensity_files' and 'mask_files' as intensity/segmentation image pairs
output_type: str (optional, default "pandas")
Output format for the features values. Valid options are "pandas", "arrowipc", and "parquet".
output_directory: str (optional, default "")
Output directory for Arrow IPC and Parquet output formats. Default is "", which is the current directory.
output_filename: str (optional, default "NyxusFeatures")
Output filename for Arrow IPC and Parquet output formats.
output_path: str (optional, default "")
Output filepath for Arrow IPC and Parquet output formats. Default is "", which is the current directory.
The output_path can either be to a directory or filename. For example,
- If 'output_path=/path/to/directory' then a file with the default name NyxusFeatures.<extension> will be created.
If the directory does not exist, it will be created.
- If 'output_path=/path/to/directory/some_file_name.arrow' then this file will be created.
If the directory does not exist, it will also be created.
- If 'output_path=some_file_name.arrow' then this file will be created in the current working directory.

Returns
-------
Expand Down
30 changes: 0 additions & 30 deletions src/nyx/python/nyxus/nyxus_arrow.py

This file was deleted.