-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle missing rules #255
Handle missing rules #255
Conversation
7643f1c
to
3c408af
Compare
9492d66
to
afe6817
Compare
a9d2d65
to
12a7906
Compare
I was trying to test this. I created a file with an unknown tag (50736). With that, I get a 500 error when the GUI tries to get the plan. Running from the command line, the error is:
Further, if I try to run the
If we can't hardlink the file (because the output is on a different device), we should copy it. |
37bc866
to
a573b12
Compare
fixed in e861b92
changed in a573b12 |
imagedephi/redact/redact.py
Outdated
failed_file = failed_dir / image_file.name | ||
# Using copy2 preserves metadata | ||
# https://docs.python.org/3/library/shutil.html#shutil.copy2 | ||
copy2(image_file, failed_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we try to hardlink this and only copy it if we can't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes that would probably be best
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in 5854456
I think it would be better to not create the failed directory or write the failed manifest if there are no failed images. |
Should the command to rerun the failed images include the output folder? More generally, if we ran the command from the command line, should the rerun command have all of the options with just the source directory different and the index parameter added? |
added in 3f60785 |
changed in 12a8027 |
275ebcf
to
be3bb47
Compare
imagedephi/redact/redact.py
Outdated
) | ||
manifest.write("failed_images_count: " + str(failed_img_counter) + "\n") | ||
index += 1 | ||
yaml_command = f"""command: > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This renders oddly and isn't quite a valid command. I get
command: imagedephi run /tmp/a/Failed_2024-10-10_15-24-43\ --output-dir /tmp/a/Redacted_2024-10-10_15-24-43\
--index 25\
in the yaml file. The first \
makes the input directory contain the following space. Probably we should jam this all on one line rather than try to break it up (it would make it easier to copy to repeart).
Further, this creates a subfolder in the original redaction folder. Either we need a flag to not put redactions in a subfolder or we shouldn't include the final segment of the path in the output directory.
This will also miss other command line options (--profile, --override-rules, --skip-rename, --recursive all probably matter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can pull the --profile
and --skip-rename
from the original command. I think on this first pass, --recursive
would be irrelevant because we are copying the failed images over into the top level of the 'failed directory'.
We wouldn't know what --override-rules
would be used. We could include it in the command as --override-rules [path-to-rules]
or some such thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the command specified --recursive
and there are two files that we can't redact that have the same name but are in different subdirectories, what happens? They would collide in the Failed folder. Rerunning on the failed images won't reconstruct the recursive folder structure if we were using --skip-rename and --recursive.
I think we want to copy whatever --override-rules
file was specified. Specifically, I could imagine that I run my set on a bunch of files and it failed on two of them. I then tweak my rules file and run it again with the new-and-improved rule file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I'll add this and the recursive behavior too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the yaml file. The first \ makes the input directory contain the following space. Probably we should jam this all on one line rather than try to break it up (it would make it easier to copy to repeart).
Further, this creates a subfolder in the original redaction folder. Either we need a flag to not put redactions in a subfolder or we shouldn't include the final segment of the path in the output directory.
fixed in 140a339
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also miss other command line options (--profile, --override-rules, --skip-rename, --recursive all probably matter).
added in 7634ad8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the command specified --recursive and there are two files that we can't redact that have the same name but are in different subdirectories, what happens? They would collide in the Failed folder. Rerunning on the failed images won't reconstruct the recursive folder structure if we were using --skip-rename and --recursive.
fixed in 9eb13dc
I ran with
The NestedMissing folder has two subfolders, with a totla of 26 images split between the two subfolders, two of which have unknown tags. I got this error:
|
Currently the I changed this behavior in #269 and that should resolve this issue. I've rebased off of that branch so this should be testable now too. |
7634ad8
to
57cb2f0
Compare
57cb2f0
to
981ff19
Compare
981ff19
to
bdaedf7
Compare
Closes #236
Closes #237
Backend Changes
run
command that indicates the starting number for renaming during redactionFrontend Changes