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

DM-22191: isr for yaml cameras is broken due to zero value for suspectLevel #180

Merged
merged 1 commit into from Nov 12, 2019

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Nov 12, 2019

Set amplifier suspect level to NaN if not defined.

@czwa czwa requested a review from erykoff November 12, 2019 22:28
Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

Possible stylistic changes below.

if 'suspect' in amp:
amplifier.setSuspectLevel(amp['suspect'])
else:
amplifier.setSuspectLevel(float('nan'))
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a stylistic thing... I personally prefer np.nan to float('nan'), but both are used in the codebase. It seems that np.nan is slightly more prevalent if that matters.

Copy link
Contributor

Choose a reason for hiding this comment

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

And this could be a bit more compact. If amp is a regular dict or dict-like thing, you can do amplifier.setSuspectLevel(amp.get('suspect', np.nan)). Though maybe this is unnecessarily fancy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I never remember the short versions of things in python until my third or fourth look. Short form adopted.

@czwa czwa merged commit 44f6c55 into master Nov 12, 2019
@timj timj deleted the tickets/DM-22191 branch June 25, 2020 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants