Bugfix/nonlinear pyroscan coordinates#536
Conversation
…ro-kinetics/pyrokinetics into bugfix/nonlinear_pyroscan_coordinates I don't know why I have to do this?
|
I think this is not preserving the units of the simulation. You might need to add the units in as an attribute EDIT I mean the units of the coordinates |
|
See these lines here pyrokinetics/src/pyrokinetics/pyroscan.py Lines 405 to 407 in 2e23864 For older versions of xarray you couldn't assign units directly to the coordinate so you would have to put the unit as an attribute. However in a newer version now you can so you could force a newer version of xarray where the coordinate has the unit or give it the attribute as above. |
|
@FelixWattsYork I've pushed a temp fix that works for now. Feel free to match the implementation you currently have though and tweak away. Would be worth adding a test to make sure the units are kept. @dake0795 checkout this branch please and give it a go? |
Just adding the test now |
…o-kinetics/pyrokinetics into bugfix/nonlinear_pyroscan_coordinates adding bhavin's changes Please enter a commit message to explain why this merge is necessary,
There was a bug in my recent PR, which meant that coordinates didn't have the associated values. Basically ky was there but you could only index it by position not value. I have added the proper coordinate adding into the code, and updated the test to check for the correct behaviour