Skip to content

Commit

Permalink
fix: use scalar num of digits on Dataset.load_snapshot (#75)
Browse files Browse the repository at this point in the history
Review n coordinate when phi is represented by more than one digit #10

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 17, 2024
1 parent 5be881b commit 8495c1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xcompact3d_toolbox/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,9 @@ def is_velocity(name):
dataset["phi"] = (
stack_variables(scalar_variables, stack_scalar=False)
.to_array(dim="n")
.assign_coords(n=[int(var[-1]) for var in scalar_variables])
.assign_coords(
n=[int(v[-self.filename_properties.scalar_num_of_digits :]) for v in scalar_variables]
)
)
set_of_variables -= set(scalar_variables)

Expand Down

0 comments on commit 8495c1c

Please sign in to comment.