-
Notifications
You must be signed in to change notification settings - Fork 20
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
Python: ShortRF
Properties
#646
Conversation
Add element properties for `ShortRF`, so it can be modified after variable creation, too.
@EZoni volunteered to complete the other leftover elements in a separate PR 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
.def_property("freq", | ||
[](ShortRF & short_rf) { return short_rf.m_freq; }, | ||
[](ShortRF & short_rf, int freq) { short_rf.m_freq = freq; }, | ||
"RF frequency in Hz" | ||
) | ||
.def_property("phase", | ||
[](ShortRF & short_rf) { return short_rf.m_phase; }, | ||
[](ShortRF & short_rf, int phase) { short_rf.m_phase = phase; }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I just noticed this, should freq
and phase
be amrex::ParticleReal
too, as opposed to int
? If so, I can fix it in the follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! Those should definitely be amrex::ParticleReal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, yes please. Copy pasted this, dang!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ax3l
I will fix it in the upcoming PR. Question, which I guess is pybind11-related: why does the compiler not complain about/catch this discrepancy between types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised as well, should issue a narrowing warning.
https://godbolt.org/z/f6bE3xPPE
Thx for the fix in #647
Add element properties for
ShortRF
, so it can be modified after variable creation, too.