Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/filecluster/image_grouper.py
#	src/filecluster/utlis.py
  • Loading branch information
izikeros committed Jun 26, 2024
2 parents 604e519 + b9126e1 commit 8cba97f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/filecluster/image_grouper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Module for file clustering and supporting operations."""

import logging
import os
import random
from collections.abc import Iterator
Expand Down Expand Up @@ -341,6 +341,12 @@ def move_files_to_cluster_folder(self):
for dir_name in dirs:
if dir_name is None:
raise DateStringNoneError()

isnan = isinstance(dir_name, float) and math.isnan(dir_name)
if dir_name is None or isnan:
raise DateStringNoneException()
# instead, create dummy date
#dir_name = "XXXX_XX_XX"
ut.create_folder_for_cluster(
config=self.config, date_string=dir_name, mode=mode
)
Expand Down
3 changes: 3 additions & 0 deletions src/filecluster/utlis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import base64
import hashlib
import logging
import os
import time
import tomllib
Expand Down Expand Up @@ -75,6 +76,8 @@ def create_folder_for_cluster(config: Config, date_string: str, mode: CopyMode):

if mode != CopyMode.NOP:
pth = Path(config.out_dir_name)
if not isinstance(date_string, str):
logger.error(f"Expected date string got: {date_string} of type: {type(date_string)}")
dir_name = (
pth / date_string
) # fixme: can raise error: TypeError: unsupported operand type(s) for /: 'WindowsPath' and 'float'
Expand Down

0 comments on commit 8cba97f

Please sign in to comment.