tidy3d
tidy3d copied to clipboard
Add option to transpose plot
by default, plotting on a plane puts the lowest transverse dimension (in 'xyz') on the x axis and the highest on the y axis.
It would be useful to be able to switch this convention with an extra kwarg transpose: bool = False
passed to Simulation.plot()
, which would flip this convention.
Sim.plot(x=0) # yz plot
Sim.plot(x=0, transpose=False) # also yz plot
Sim.plot(x=0, transpose=True) # zy plot
Notes:
- [ ] should also be applied to
Simulation.plot_eps()
- [ ] This notebook can be useful for additional testing.
- [ ] Be careful to ensure that the
hlim
andvlim
arguments are applied to the transposed dimensions.
Deliverables:
- [ ] PR into
develop
including- [ ] the front end code changes
- [ ] a test that adds a
transpose=True
in a simulation plotting, eg intests/test_components/test_simulation.py
- [ ] a line in the changelog under "added" explaining what is done.
Notes:
- [ ] We use git rebase to ensure that there's a linear history, so the feature branch ideally should be rebased against
develop
and squashed into a single commit. - [ ] For testing and formatting
- [ ] To get everything needed, from the root level of the tidy3d directory, run `pip install -e ".[dev]".
- [ ] Our code formatting and listing is done with
ruff
andblack
.black .
andruff check tidy3d
- [ ] Our tests can be run with
pytest tests
, more info here: https://github.com/flexcompute/tidy3d/blob/develop/tests/README.md
@m-bone since you've already been digging in the plotting code a bit, can you take this one on as well? Could be a good 2nd warmup for our development flow so you can get a little more practice. hopefully the code bits are pretty minor. Thanks!