Added additional save features to SaveCroppedObjects#4545
Conversation
…to prevent accidental overwriting
|
So for this I've hit a bit of a roadblock, namely trying to get the filename tests to work. I've included what I've tried so far in here. Basically, the error arises in response to the The same method I'm using is also used in SaveImages, but test_saveimages does not cover this method. |
|
So, a couple of things here - First of all, I missed that in the main module itself, we definitely need to bump the module version and add an upgrade_settings function for upgrading the version - apologies for missing that earlier! Second of all, as currently written, we're not "[Adding] the option to add input filenames to output crops" (emphasis mine), we're actually enforcing it. 95% of the time, I think this is what users want, but it's ultimately a breaking change. As such, we either need to a) make it an option and/or b) we should hold it for CP5. In general, I'm nearly always in favor of making things optional, but I understand the need to sometimes stop the option-creep. If we do make it optional, I'm fine with having the default be True for newly added modules, but we want it to be "False" for upgraded modules in your upgrade_settings that you'll be adding. Finally, RE: tests, I see what you were trying to do here @callum-jpg, but you were going at it in a harder way than you needed to - rather than forcing CellProfiler to load the data the way that you wanted, just making sure CellProfiler has the information it's going to need to do the thing you want to check is WAY easier, and ultimately, what we care about here - we don't actually want to test CellProfiler image loading here, we just want to test that it will make file names the way we want them to. Make sense? I removed them, because I think there are going to be easier ways to do what you want to do, and because there are still module decisions to make, but you can always get them back in the commit history.
I threw some time on your calendar to walk through all of this later today, in case anything was unclear here! |
|
Per an offline conversation, we're going to change this behavior to be optional, and try to get it into 4.2.2. Should be simple from here! |
|
When running pytest on |
|
Added the new file format to the help docs, but other than that looks good to me. |




Added the option to add input filenames to output crops and also the possibility to save output crops into nested folders.