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

fpr_photo_qa not catching certain duplicates #61

Open
lucy-schick opened this issue Mar 5, 2024 · 2 comments
Open

fpr_photo_qa not catching certain duplicates #61

lucy-schick opened this issue Mar 5, 2024 · 2 comments

Comments

@lucy-schick
Copy link
Collaborator

fpr_photo_qa is not catching certain duplicates. See example below with _inlet copy photo

image

Usually we do not want there to be:

  1. spaces in file names
  2. duplicates of reserved names for PSCIS required photos (ex. *_inlet.JPG and *inlet2.JPG are fine to submit but *inlet.JPG and *inlet copy.JPG may not be.

fpr_photo_qa_df is not catching this duplicate because it looks like fpr_photo_qa is not returning a list when it should be since there are 2 inlet photos (see screenshot).

I think this is happening because this line in fpr_photo_qa

stringr::str_subset(., '_barrel\\.|_outlet\\.|_upstream\\.|_downstream\\.|_road\\.|_inlet\\.') %>%

is only returning photos that contain the _reserved name ending with a . (example _intlet.) and since the copy photo is _inlet copy it doesn't grab it and therefore won't return a list.

Just tried removing \\. so that it returns photos with any ending and it does include the copy photo but got some other errors.

stringr::str_subset(., '_barrel |_outlet |_upstream |_downstream |_road |_inlet') %>%

Screen Shot 2024-02-29 at 2 15 06 PM

@NewGraphEnvironment
Copy link
Owner

fpr_photo_qa2 is an updated fpr_photo_qa that should catch all duplicate photos

here are some examples of how to use without the help of fpr_photo_qa_df which still relies on fpr_photo_qa

qa_all <- fpr::fpr_photo_qa2(
  dat = form_both,
  dir_photos = dir_photos
) %>%
  data.table::rbindlist(fill = TRUE)


# here is the test for missing individual photos
fpr::fpr_photo_qa2(
  dat = form_both,
  dir_photos = dir_photos
) |>
  bind_rows() |>
  dplyr::filter(if_any(everything(), is.na))

NewGraphEnvironment added a commit that referenced this issue Oct 31, 2024
@NewGraphEnvironment
Copy link
Owner

these examples need to be added to the docs and now that we have confirmation that duplicates are actually an ishy we can swap fpr_photo_qa2 changes into fpr_photo_qa. Legacy string search for reserved photos (ex. _barrel\\. will come in handy for a future renaming function that can rename the offending photos when they are not our target reserved photo submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants