-
Notifications
You must be signed in to change notification settings - Fork 183
/
Makefile
238 lines (177 loc) · 5.06 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
233
234
235
236
237
238
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: plugins
pip install -e .[docs,dev,full]
all: plugins install full
install:
pip install -e .[full,dev] pre-commit
pre-commit install
gf install klayout-genericpdk
gf install git-diff
dev: full
pre-commit install
gf install klayout-genericpdk
plugins:
conda install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
conda install -c conda-forge slepc4py=*=complex* -y
pip install -e .[tidy3d,ray,sax,devsim,meow,database,femwell,meshwell]
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 meshwell --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 meshwell --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
publish:
anaconda upload environment.yml
update-pre:
pre-commit autoupdate --bleeding-edge
gds:
python gdsfactory/components/straight.py
data-upload:
echo 'no need to upload'
# aws s3 sync data s3://gdslib
# gh release upload v6.90.3 data/gds/*.gds --clobber
test-data:
git clone https://github.com/gdsfactory/gdsfactory-test-data.git -b test-data test-data
data-download: test-data
echo 'Make sure you git pull inside test-data folder'
data-download-old:
aws s3 sync s3://gdslib data --no-sign-request
# gh release download v6.90.3 -D data/gds/*.gds --clobber
# gh release download v6.90.3 data/sp/*.npz --clobber
# gh release download v6.90.3 data/sp/*.yml --clobber
# gh release download v6.90.3 data/modes/*.msh --clobber
# gh release download v6.90.3 data/modes/*.npz --clobber
data-clean:
aws s3 rm data s3://gdslib/gds
test:
pytest -s
test-force:
pytest --force-regen -s
test-watch:
ptw
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 \
--ignore=gdsfactory/simulation/sipann/ \
--ignore=gdsfactory/simulation/devsim \
--ignore=gdsfactory/simulation/simphony
test-plugins-no-tidy3d:
pytest gdsfactory/simulation \
--ignore=gdsfactory/simulation/sipann/ \
--ignore=gdsfactory/simulation/simphony \
--ignore=gdsfactory/simulation/devsim \
--ignore=gdsfactory/simulation/gtidy3d
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 .github/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
notebooks:
jupytext gdsfactory/samples/notebooks/*.md --to ipynb notebooks/
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
jupytext-clean:
jupytext docs/**/*.py --to py
notebooks:
# jupytext docs/notebooks/*.py --to ipynb
# jupytext docs/notebooks/*.ipynb --to to
jupytext --pipe black docs/notebooks/*.py
.PHONY: gdsdiff build conda gdslib docs doc