forked from kch3782/gdsfactory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
232 lines (171 loc) · 4.91 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
help:
@echo 'make install: Install package, hook, notebooks and gdslib'
@echo 'make test: Run tests with pytest'
@echo 'make test-force: Rebuilds regression test'
full: gdslib plugins
pip install -e .[docs,dev,full,gmsh,tidy3d,devsim,meow,sax]
all: gdslib plugins install full
install:
pip install -e .[full,dev] pre-commit
pre-commit install
gf install klayout-integration
dev: full
pre-commit install
gf install klayout-integration
mamba:
bash conda/mamba.sh
patch:
bumpversion patch
python docs/write_components_doc.py
minor:
bumpversion minor
python docs/write_components_doc.py
major:
bumpversion major
python docs/write_components_doc.py
plugins:
conda install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
conda install -c conda-forge slepc4py=*=complex* -y
pip install jax jaxlib numpy femwell --upgrade
pip install -e .[tidy3d,ray,sax,devsim,meow,database]
plugins-conda:
conda install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
conda install -c conda-forge slepc4py=*=complex* -y
pip install jax jaxlib numpy femwell --upgrade
pip install -e .[tidy3d,ray,sax,devsim,meow,database]
plugins-mamba:
mamba install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
mamba install -c conda-forge slepc4py=*=complex* -y
pip install jax jaxlib numpy femwell --upgrade
pip install -e .[tidy3d,ray,sax,devsim,meow]
plugins-debian: plugins
sudo apt-get update
sudo apt-get install -y python3-gmsh gmsh
thermal:
conda install python-gmsh
gmsh:
pip install trimesh mapbox_earcut gmsh meshio pygmsh pyvista h5py
meep:
conda install pymeep=*=mpi_mpich_* -y
sax:
pip install jax jaxlib
publish:
anaconda upload environment.yml
update-pre:
pre-commit autoupdate --bleeding-edge
gds:
python gdsfactory/components/straight.py
gdslib-clean:
rm -rf $(HOME)/.gdsfactory
rm -rf gdslib
gdslib:
git clone https://github.com/gdsfactory/gdslib.git -b main gdslib
rm -rf $(HOME)/.gdsfactory
ln -sf gdslib $(HOME)/.gdsfactory
gdslib-link:
ln -sf gdslib $(HOME)/.gdsfactory
test:
pytest -s
test-force:
echo 'Regenerating component metadata for regression test. Make sure there are not any unwanted regressions because this will overwrite them'
rm -rf gdslib/gds/gds_ref
rm -rf gdsfactory/samples/pdk/test_fab_c.gds
pytest --force-regen
test-meep:
pytest gdsfactory/simulation/gmeep
test-tidy3d:
pytest gdsfactory/simulation/gtidy3d
test-gmsh:
pytest gdsfactory/simulation/gmsh
test-femwell:
pytest gdsfactory/simulation/fem
test-plugins:
pytest gdsfactory/simulation/gmeep gdsfactory/simulation/modes gdsfactory/simulation/lumerical gdsfactory/simulation/gmsh tests/test_klayout gdsfactory/simulation/fem gdsfactory/simulation/gtidy3d
test-plugins-no-tidy3d:
pytest gdsfactory/simulation/gmeep gdsfactory/simulation/modes gdsfactory/simulation/lumerical gdsfactory/simulation/gmsh tests/test_klayout gdsfactory/simulation/fem
test-notebooks:
py.test --nbval notebooks
diff:
python gdsfactory/merge_cells.py
cov:
pytest --cov=gdsfactory
venv:
python3 -m venv env
pipenv:
pip install pipenv --user
pipenv install
pyenv3:
pyenv shell 3.7.2
virtualenv venv
source venv/bin/activate
python -V # Print out python version for debugging
which python # Print out which python for debugging
python setup.py develop
docker-debug:
docker run -it joamatab/gdsfactory sh
docker-build:
docker build -t joamatab/gdsfactory .
docker-run:
docker run \
-p 8888:8888 \
-p 8082:8082 \
-e JUPYTER_ENABLE_LAB=yes \
joamatab/gdsfactory:latest
conda:
conda env create -f environment.yml
echo 'conda env installed, run `conda activate gdsfactory` to activate it'
mypy:
mypy gdsfactory --ignore-missing-imports
build:
rm -rf dist
pip install build
python -m build
upload-devpi:
pip install devpi-client wheel
devpi upload --format=bdist_wheel,sdist.tgz
upload-twine: build
pip install twine
twine upload dist/*
release:
git push
git push origin --tags
lint:
tox -e flake8
pylint:
pylint --rcfile .pylintrc gdsfactory/
lintdocs:
flake8 --select RST
pydocstyle:
pydocstyle gdsfactory
doc8:
doc8 docs/
autopep8:
autopep8 --in-place --aggressive --aggressive **/*.py
codestyle:
pycodestyle --max-line-length=88
doc:
python docs/write_components_doc.py
docs:
jb build docs
git-rm-merged:
git branch -D `git branch --merged | grep -v \* | xargs`
link:
lygadgets_link gdsfactory/klayout
constructor:
conda install constructor -y
constructor conda
nbqa:
nbqa blacken-docs docs/notebooks/**/*.ipynb --nbqa-md
nbqa blacken-docs docs/notebooks/*.ipynb --nbqa-md
nbqa isort docs/notebooks/*.ipynb --float-to-top
nbqa isort docs/notebooks/**/*.ipynb --float-to-top
nbqa ruff --fix docs/notebooks/*.ipynb
nbqa ruff --fix docs/**/*.ipynb
nbqa autopep8 -i docs/notebooks/*.ipynb
nbqa autopep8 -i docs/notebooks/**/*.ipynb
jupytext:
jupytext **/*.ipynb --to py
notebooks:
jupytext docs/notebooks/**/*.py --to ipynb
jupytext docs/notebooks/*.py --to ipynb
.PHONY: gdsdiff build conda gdslib docs doc