Skip to content

Commit

Permalink
Merge pull request #125 from osyris-project/allow-dict-direction
Browse files Browse the repository at this point in the history
Allow to specify 3 vectors as direction
  • Loading branch information
nvaytet authored Apr 5, 2024
2 parents d335bef + 903297a commit b488888
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/osyris/plot/direction.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def get_direction(direction=None, dataset=None, dx=None, dy=None, origin=None):
v = direction.cross(dir_vecs["pos_u"])
v.name = "pos_v"
dir_vecs["pos_v"] = v
elif isinstance(direction, dict):
dir_vecs = direction.copy()
assert "normal" in dir_vecs
assert "pos_u" in dir_vecs
assert "pos_v" in dir_vecs
else:
raise ValueError(f"Bad direction for slice: {direction}.")

Expand Down

0 comments on commit b488888

Please sign in to comment.