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

Fix rescale_raw_images error #398

Merged
merged 1 commit into from
Jul 26, 2023
Merged

Fix rescale_raw_images error #398

merged 1 commit into from
Jul 26, 2023

Conversation

camisowers
Copy link
Contributor

@camisowers camisowers commented Jul 25, 2023

If you haven't already, please read through our contributing guidelines before opening your PR

What is the purpose of this PR?

Closes #310. If the cell in the rosetta notebook containing rosetta.rescale_raw_images() is run more than once, it will give an error messages that is confusing for the user. We instead want to simply skip any images that have already been rescaled and saved the the subfolder.

How did you implement your changes

  1. Only create the rescaled subdir if it doesn't exist.
  2. Check for existing channel images in the directory before repeating the process of loading in, scaling, and saving all the images.
  3. Update the tests to check the files are not being overwritten when the function is called again.

Remaining issues

N/A

@camisowers camisowers added the bug Something isn't working label Jul 25, 2023
@camisowers camisowers self-assigned this Jul 25, 2023
Copy link
Contributor

@srivarra srivarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@alex-l-kong alex-l-kong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One clarification related to @HPiyadasa's method in #310

src/toffy/rosetta.py Show resolved Hide resolved
@alex-l-kong alex-l-kong self-requested a review July 26, 2023 21:09
@ngreenwald ngreenwald merged commit 9b3155f into main Jul 26, 2023
4 checks passed
@ngreenwald ngreenwald deleted the fix_rescale_error branch July 26, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When possible make functions check if exist = skip, if not = run, rather than producing error
4 participants