Skip to content

Conversation

@stevenhua0320
Copy link
Contributor

@zmx27 ready to review

try:
rv = tifffile.imread(im)
except:
except ImportError:
Copy link
Contributor

Choose a reason for hiding this comment

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

To me, it seems like we are assuming that tifffile is imported properly, and that we are calling a function from that package inside the try block. So maybe OSError or ValueError would make sense here? Because we want to make sure any image loading errors are handled properly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in new commits.

rcParams["backend"] = "Qt4Agg"
try:
import PySide
import PySide # noqa: F401
Copy link
Contributor

Choose a reason for hiding this comment

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

Why #noqa in these lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because flake8 gives F401 error here, but actually I think it is implicitly used in the next line rcParams["backend.qt4"] = "PySide". Therefore, we should not delete it, that's why I make #noqa here.

@stevenhua0320 stevenhua0320 requested a review from zmx27 October 20, 2025 00:33
try:
import matplotlib.pyplot as plt
import PyQt4
import PyQt4 # noqa: F401
Copy link
Contributor

Choose a reason for hiding this comment

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

This import seems safe to delete. By the way, I'm kind of nitpicking here because in general, we don't want to suppress any warnings or exclude any files if possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have deleted it, see the new commit.

try:
rv = tifffile.imread(im)
except:
except ValueError:
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, maybe include OSError as well? Should have mentioned that, sorry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have updated in the new commit.

@stevenhua0320 stevenhua0320 requested a review from zmx27 October 20, 2025 00:51
@stevenhua0320
Copy link
Contributor Author

@sbillinge Ready to review this one

@sbillinge sbillinge merged commit 59fcc9f into diffpy:migration Oct 20, 2025
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

Successfully merging this pull request may close these issues.

3 participants