Skip to content

Commit

Permalink
finished test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yrkim98 committed Feb 15, 2024
1 parent 0667e16 commit c440a77
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_populate_input_channel_combobox(qtbot: QtBot) -> None:
# Arrange
prediction_model: PredictionModel = PredictionModel()
prediction_file_input: PredictionFileInput = PredictionFileInput(
prediction_model
prediction_model, viewer=FakeViewer()
)
prediction_model.set_max_channels(6)

Expand Down
6 changes: 4 additions & 2 deletions src/allencell_ml_segmenter/_tests/test_files/csv/test_csv.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
to_predict
./src/allencell_ml_segmenter/_tests/test_files/images/test_2_channels.tiff
,raw,split
0,./src/allencell_ml_segmenter/_tests/test_files/images/test_2_channels.tiff,test
1,./src/allencell_ml_segmenter/_tests/test_files/images/test_2_channels.tiff,test
2,./src/allencell_ml_segmenter/_tests/test_files/images/test_2_channels.tiff,test
3 changes: 1 addition & 2 deletions src/allencell_ml_segmenter/prediction/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def extract_num_channels_in_folder(self, path: Path) -> int:
# ignore hidden files
while str(first_image.name).startswith("."):
first_image = next(path_generator)

extract_num_channels_from_image(str(first_image.resolve()))
return extract_num_channels_from_image(str(first_image.resolve()))

def extract_num_channels_from_csv(self, path: Path):
with open(path) as file:
Expand Down
2 changes: 1 addition & 1 deletion src/allencell_ml_segmenter/services/prediction_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def build_overrides(
def write_csv_for_inputs(self, list_images: List[Path]) -> None:
data_folder: Path = self._experiments_model.get_csv_path()
data_folder.mkdir(parents=False, exist_ok=True)
csv_path: Path = data_folder / "prediction_input.csv"
csv_path: Path = data_folder / "test_csv.csv"
with open(csv_path, "w") as file:
writer: csv.writer = csv.writer(file)
writer.writerow(["", "raw", "split"])
Expand Down

0 comments on commit c440a77

Please sign in to comment.