Skip to content

Bugfix/nonlinear pyroscan coordinates#536

Merged
bpatel2107 merged 10 commits intounstablefrom
bugfix/nonlinear_pyroscan_coordinates
Mar 19, 2026
Merged

Bugfix/nonlinear pyroscan coordinates#536
bpatel2107 merged 10 commits intounstablefrom
bugfix/nonlinear_pyroscan_coordinates

Conversation

@FelixWattsYork
Copy link
Copy Markdown
Collaborator

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

@bpatel2107
Copy link
Copy Markdown
Collaborator

bpatel2107 commented Mar 18, 2026

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

@bpatel2107
Copy link
Copy Markdown
Collaborator

See these lines here

for coord, units in coord_units.items():
ds[coord] = ds[coord].assign_attrs(units=units)

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.

@bpatel2107
Copy link
Copy Markdown
Collaborator

@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?

@FelixWattsYork
Copy link
Copy Markdown
Collaborator Author

@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

FelixWattsYork and others added 3 commits March 18, 2026 11:38
…o-kinetics/pyrokinetics into bugfix/nonlinear_pyroscan_coordinates

adding bhavin's changes
 Please enter a commit message to explain why this merge is necessary,
@bpatel2107 bpatel2107 merged commit 31ea729 into unstable Mar 19, 2026
1 check passed
@bpatel2107 bpatel2107 deleted the bugfix/nonlinear_pyroscan_coordinates branch March 19, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants