Closed ken-lauer closed 1 month ago
@ChristopherMayes I've added support for these aliases (in #41) but there are some back-compatibility string key handling lines that need fixing. I'd like your thoughts as to how best to handle these 2 cases:
output.stat("power")
)plot(y=["power"])
)Currently, anything with "power"
in it will collapse into field_harmonics[1].peak_power
. This is clearly incorrect. How should this be handled so that there will be the least amount of confusion for users?
(Changing this may come as a surprise to users who incorrectly have an incorrect alias with "power" in it, but I think it's important to fix regardless)
There's no way to make sense of averaging the field power for creating the stats data, so I had 'corrected' the request for plotting power as the peak power. Now we should probably just disallow that, and instead have the user request peak_power
from the stats. We could throw in a helpful message in the error.
There's no way to make sense of averaging the field power for creating the stats data, so I had 'corrected' the request for plotting power as the peak power. Now we should probably just disallow that, and instead have the user request
peak_power
from the stats. We could throw in a helpful message in the error.
Attempt at that is here: https://github.com/slaclab/lume-genesis/pull/41/commits/cf1b1c4b3a95ced89ecb7153e28a8208e155005b
power
key catch-all is back-compat that should go away from Chris's original code:https://github.com/ken-lauer/lume-genesis/blob/a15c20ec1d4c3fe2a4c60496619fe09c8a7cd8c4/genesis/version4/output.py#L1618-L1622
field_harmonics[N].attr
field3_energy
(for example) would be a good pattern here