Skip to content

Commit b62a09f

Browse files
committed
Update phrasing for how many desired images downloaded
1 parent b9fcf09 commit b62a09f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ head -n 2 examples/HCGSD_test_MD5_mismatch_missing.csv
162162
# 1. Download the images
163163
cautious-robot --input-file examples/HCGSD_testNA.csv --output-dir examples/test_images
164164
# 2. Remove some of the images
165-
rm ./examples/test_images/104281
165+
rm ./examples/test_images/104281*
166166
# 3. Download the same set of images to get only those removed at 2
167167
cautious-robot --input-file examples/HCGSD_testNA.csv --output-dir examples/test_images
168168
```

src/cautiousrobot/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,6 @@ def check_existing_images(csv_path, img_dir, source_df, filename_col, subfolders
158158
else:
159159
# Print directory status message - pre-download
160160
num_existing = len(existing_files)
161-
print(f"There are {num_existing} of desired files in {img_dir}. Based on {csv_path}, {filtered_df.shape[0]} images should be downloaded.")
161+
print(f"There are {num_existing} of the desired files already in {img_dir}. Based on {csv_path}, {filtered_df.shape[0]} images should be downloaded.")
162162

163163
return df, filtered_df

tests/test_existing_images.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_some_files_exist(self, mock_print, mock_gather, mock_exists):
3838
self.assertFalse(updated_df.loc[2, "in_img_dir"]) # c.jpg missing
3939
self.assertEqual(len(filtered_df), 2)
4040
mock_print.assert_called_once()
41-
self.assertIn("There are 1 of desired files", mock_print.call_args[0][0])
41+
self.assertIn("There are 1 of the desired files", mock_print.call_args[0][0])
4242

4343
@patch("cautiousrobot.utils.os.path.exists", return_value=True)
4444
@patch("cautiousrobot.utils.gather_file_paths", return_value=["test_images/a.jpg", "test_images/b.jpg", "test_images/c.jpg"])
@@ -64,7 +64,7 @@ def test_no_files_exist(self, mock_print, mock_gather, mock_exists):
6464
self.assertFalse(any(updated_df["in_img_dir"]))
6565
self.assertEqual(len(filtered_df), len(self.sample_df))
6666
mock_print.assert_called_once()
67-
self.assertIn("There are 0 of desired files", mock_print.call_args[0][0])
67+
self.assertIn("There are 0 of the desired files", mock_print.call_args[0][0])
6868

6969
@patch("cautiousrobot.utils.os.path.exists", return_value=True)
7070
@patch("cautiousrobot.utils.gather_file_paths", return_value=["test_images/species1/a.jpg", "test_images/shouldnotcount/b.jpg"])

0 commit comments

Comments
 (0)