Check the precision for the thickness and stop complaining for difference in the nm scale#2770
Merged
kif merged 7 commits intosilx-kit:mainfrom Jan 30, 2026
Merged
Conversation
Collaborator
|
@kif I see you are working on this issue. I would like to show you my version in a bit, too. Should I do this in a new PR then? |
Member
Author
|
You can submit another PR ... |
gudlot
approved these changes
Jan 27, 2026
gudlot
reviewed
Jan 27, 2026
src/pyFAI/detectors/sensors.py
Outdated
| return self.thickness == other.thickness | ||
| if isinstance(other, self.__class__): | ||
| if (self.material == other.material): | ||
| if self.thickness and other.thickness and abs(self.thickness - other.thickness)<1e-6: |
Collaborator
There was a problem hiding this comment.
Another option would be to use isclose
isclose(self.thickness, other.thickness, abs_tol=SensorConfig.THICKNESS_TOLERANCE)
I declared the tolerance as class variable.
gudlot
reviewed
Jan 30, 2026
src/pyFAI/detectors/_common.py
Outdated
| if isinstance(sensor, SensorConfig): | ||
| if sensor not in self.SENSORS: | ||
| logger.warning("Sensor %s not in allowed SENSORS: %s", sensor, self.SENSORS) | ||
| logger.warning("Sensor %s not in allowed SENSORS: [%s].", sensor, "|".join([str(i) for i in self.SENSORS])) |
Collaborator
There was a problem hiding this comment.
@kif Could you also choose here directly a generator comprehension?
gudlot
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #2765