-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1802 from gdsfactory/improve_plot_jupyter
Improve plot jupyter
- Loading branch information
Showing
7 changed files
with
78 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 27 additions & 7 deletions
34
gdsfactory/samples/notebooks/workflow_jupyter_notebooks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,52 @@ | ||
# --- | ||
# jupyter: | ||
# jupytext: | ||
# cell_metadata_filter: -all | ||
# custom_cell_magics: kql | ||
# text_representation: | ||
# extension: .py | ||
# format_name: percent | ||
# format_version: '1.3' | ||
# jupytext_version: 1.11.2 | ||
# kernelspec: | ||
# display_name: base | ||
# language: python | ||
# name: python3 | ||
# --- | ||
|
||
# %% [markdown] | ||
# # Jupyter notebooks | ||
# | ||
# Working with Jupyter notebooks is great for learning gdsfactory as well as running heavy simulations on Cloud servers. | ||
# | ||
# Thanks to [kweb](https://github.com/gdsfactory/kweb) you can use the webapp version on klayout in your browser or inside jupyter notebooks. | ||
|
||
# + | ||
import kweb.server_jupyter as kj # requires `pip install gdsfactory[full]` or `pip install kweb` | ||
# %% | ||
import gdsfactory as gf | ||
|
||
gf.config.rich_output() | ||
PDK = gf.get_generic_pdk() | ||
PDK.activate() | ||
|
||
gf.config.set_log_level("DEBUG") | ||
kj.start() | ||
# - | ||
gf.CONF.display_type = "kweb" | ||
|
||
# %% | ||
c = gf.components.mzi() | ||
|
||
c.plot_jupyter() | ||
# %% | ||
c.plot() | ||
|
||
# %% | ||
c = gf.components.bend_circular() | ||
c.plot_jupyter() | ||
|
||
# %% | ||
c = gf.components.straight_heater_meander() | ||
c.plot_jupyter() | ||
c.plot() | ||
|
||
# %% | ||
c.plot() | ||
|
||
# %% | ||
s = c.to_3d() | ||
s.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters