treizh commited on
Commit
3ceba08
·
1 Parent(s): 36d6972

Fixed environment startup version

Browse files
Files changed (7) hide show
  1. .python-version +1 -1
  2. Dockerfile +1 -1
  3. app.py +57 -25
  4. main.py +6 -0
  5. pyproject.toml +5 -3
  6. requirements.txt +36 -60
  7. uv.lock +0 -0
.python-version CHANGED
@@ -1 +1 @@
1
- 3.10
 
1
+ 3.14
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.10
2
 
3
  WORKDIR /code
4
 
 
1
+ FROM python:3.14
2
 
3
  WORKDIR /code
4
 
app.py CHANGED
@@ -6,6 +6,7 @@ import numpy as np
6
 
7
  import matplotlib.pyplot as plt
8
  from matplotlib.figure import Figure
 
9
  import matplotlib as mpl
10
 
11
  from pypdf import PdfWriter
@@ -92,8 +93,10 @@ def draw_tray(
92
  fontsize=14,
93
  plaque_index: str | None = None,
94
  print_coordinates: bool = False,
 
95
  coord_bf: bool = False,
96
  coord_font_size: int = 10,
 
97
  ):
98
  t = np.zeros((row_count * discs_per_leaf, col_count))
99
  if is_valid_forbibden_position(forbidden_position):
@@ -121,9 +124,39 @@ def draw_tray(
121
 
122
  def is_valid(a, i, j):
123
  return a is not None and 0 <= i < a.shape[0] and 0 <= j < a.shape[1]
 
 
124
 
125
  for i, line in enumerate(axii):
126
  for j, ax in enumerate(line):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  if print_coordinates is True:
128
  ax.text(
129
  left + 0.02,
@@ -145,6 +178,16 @@ def draw_tray(
145
  transform_rotates_text=True,
146
  fontweight="bold" if coord_bf is True else "normal",
147
  )
 
 
 
 
 
 
 
 
 
 
148
  if i == 0 and j == 0 and plaque_index is not None and t[i, j] == 1:
149
  ax.set_facecolor("xkcd:light grey")
150
  ax.text(
@@ -155,31 +198,20 @@ def draw_tray(
155
  horizontalalignment="center",
156
  verticalalignment="center",
157
  )
158
- else:
159
- if t[i, j] == 1:
160
- ax.set_facecolor("xkcd:black")
161
- elif color_data is None:
162
- match t[i, j]:
163
- case 0:
164
- ax.set_facecolor("xkcd:white")
165
- case 2:
166
- ax.set_facecolor("xkcd:salmon")
167
- elif is_valid(color_data, i, j) and np.isnan(color_data[i, j]) != True:
168
- ax.set_facecolor(colors[int(color_data[i, j].astype(int))])
169
- if (
170
- text_data is not None
171
- and is_valid(text_data, i, j)
172
- and isinstance(text_data[i, j], str) is True
173
- ):
174
- ax.text(
175
- 0.5,
176
- 0.5,
177
- text_data[i, j],
178
- dict(size=fontsize),
179
- horizontalalignment="center",
180
- verticalalignment="center",
181
- transform=ax.transAxes,
182
- )
183
  ax.set_xticklabels([])
184
  ax.set_yticklabels([])
185
  ax.set_xticks([])
 
6
 
7
  import matplotlib.pyplot as plt
8
  from matplotlib.figure import Figure
9
+ from matplotlib.patches import Circle
10
  import matplotlib as mpl
11
 
12
  from pypdf import PdfWriter
 
93
  fontsize=14,
94
  plaque_index: str | None = None,
95
  print_coordinates: bool = False,
96
+ print_index: bool = False,
97
  coord_bf: bool = False,
98
  coord_font_size: int = 10,
99
+ leaf_size: int|None = None,
100
  ):
101
  t = np.zeros((row_count * discs_per_leaf, col_count))
102
  if is_valid_forbibden_position(forbidden_position):
 
124
 
125
  def is_valid(a, i, j):
126
  return a is not None and 0 <= i < a.shape[0] and 0 <= j < a.shape[1]
127
+
128
+ leaf_index = 0
129
 
130
  for i, line in enumerate(axii):
131
  for j, ax in enumerate(line):
132
+ if t[i, j] != 1:
133
+ leaf_index +=1
134
+ # Draw background
135
+ if i == 0 and j == 0 and plaque_index is not None and t[i, j] == 1:
136
+ ax.set_facecolor("xkcd:light grey")
137
+ else:
138
+ if t[i, j] == 1:
139
+ ax.set_facecolor("xkcd:black")
140
+ elif color_data is None:
141
+ match t[i, j]:
142
+ case 0:
143
+ ax.set_facecolor("xkcd:white")
144
+ case 2:
145
+ ax.set_facecolor("xkcd:salmon")
146
+ elif is_valid(color_data, i, j) and np.isnan(color_data[i, j]) != True:
147
+ ax.set_facecolor(colors[int(color_data[i, j].astype(int))])
148
+ # Draw leafs
149
+ if leaf_size is not None and leaf_size > 0 and t[i, j] != 1:
150
+ ax.add_patch(
151
+ Circle(
152
+ xy=(0.5,0.5),
153
+ radius=leaf_size / 2,
154
+ edgecolor="green",
155
+ facecolor="lime",
156
+ linewidth=1,
157
+ )
158
+ )
159
+ # Write text
160
  if print_coordinates is True:
161
  ax.text(
162
  left + 0.02,
 
178
  transform_rotates_text=True,
179
  fontweight="bold" if coord_bf is True else "normal",
180
  )
181
+ if print_index is True:
182
+ ax.text(
183
+ 0.5,
184
+ 0.5,
185
+ str(leaf_index),
186
+ dict(size=fontsize),
187
+ horizontalalignment="center",
188
+ verticalalignment="center",
189
+ transform=ax.transAxes,
190
+ )
191
  if i == 0 and j == 0 and plaque_index is not None and t[i, j] == 1:
192
  ax.set_facecolor("xkcd:light grey")
193
  ax.text(
 
198
  horizontalalignment="center",
199
  verticalalignment="center",
200
  )
201
+ if (
202
+ text_data is not None
203
+ and is_valid(text_data, i, j)
204
+ and isinstance(text_data[i, j], str) is True
205
+ ):
206
+ ax.text(
207
+ 0.5,
208
+ 0.5,
209
+ text_data[i, j],
210
+ dict(size=fontsize),
211
+ horizontalalignment="center",
212
+ verticalalignment="center",
213
+ transform=ax.transAxes,
214
+ )
 
 
 
 
 
 
 
 
 
 
 
215
  ax.set_xticklabels([])
216
  ax.set_yticklabels([])
217
  ax.set_xticks([])
main.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ def main():
2
+ print("Hello from vitis-exp-builder!")
3
+
4
+
5
+ if __name__ == "__main__":
6
+ main()
pyproject.toml CHANGED
@@ -3,13 +3,15 @@ name = "vitis-exp-builder"
3
  version = "0.1.0"
4
  description = "Add your description here"
5
  readme = "README.md"
6
- requires-python = ">=3.10"
7
  dependencies = [
 
8
  "ipywidgets-bokeh>=1.7.0",
9
  "jupyter>=1.1.1",
 
10
  "matplotlib>=3.10.8",
11
- "numpy>=2.2.6",
12
- "pandas>=2.3.3",
13
  "panel>=1.8.10",
14
  "pypdf>=6.9.2",
15
  "watchfiles>=1.1.1",
 
3
  version = "0.1.0"
4
  description = "Add your description here"
5
  readme = "README.md"
6
+ requires-python = ">=3.14"
7
  dependencies = [
8
+ "black>=26.3.1",
9
  "ipywidgets-bokeh>=1.7.0",
10
  "jupyter>=1.1.1",
11
+ "jupyter-bokeh>=4.0.5",
12
  "matplotlib>=3.10.8",
13
+ "numpy>=2.4.4",
14
+ "pandas>=3.0.2",
15
  "panel>=1.8.10",
16
  "pypdf>=6.9.2",
17
  "watchfiles>=1.1.1",
requirements.txt CHANGED
@@ -25,6 +25,8 @@ babel==2.18.0
25
  # via jupyterlab-server
26
  beautifulsoup4==4.14.3
27
  # via nbconvert
 
 
28
  bleach==6.3.0
29
  # via
30
  # nbconvert
@@ -32,6 +34,7 @@ bleach==6.3.0
32
  bokeh==3.9.0
33
  # via
34
  # ipywidgets-bokeh
 
35
  # panel
36
  certifi==2026.2.25
37
  # via
@@ -42,21 +45,20 @@ cffi==2.0.0
42
  # via
43
  # argon2-cffi-bindings
44
  # pyzmq
45
- charset-normalizer==3.4.6
46
  # via requests
 
 
47
  colorama==0.4.6 ; sys_platform == 'win32'
48
  # via
 
49
  # ipython
50
  # tqdm
51
  comm==0.2.3
52
  # via
53
  # ipykernel
54
  # ipywidgets
55
- contourpy==1.3.2 ; python_full_version < '3.11'
56
- # via
57
- # bokeh
58
- # matplotlib
59
- contourpy==1.3.3 ; python_full_version >= '3.11'
60
  # via
61
  # bokeh
62
  # matplotlib
@@ -68,10 +70,6 @@ decorator==5.2.1
68
  # via ipython
69
  defusedxml==0.7.1
70
  # via nbconvert
71
- exceptiongroup==1.3.1 ; python_full_version < '3.11'
72
- # via
73
- # anyio
74
- # ipython
75
  executing==2.2.1
76
  # via stack-data
77
  fastjsonschema==2.21.2
@@ -98,27 +96,18 @@ ipykernel==6.31.0
98
  # jupyter
99
  # jupyter-console
100
  # jupyterlab
101
- ipython==8.39.0 ; python_full_version < '3.11'
102
- # via
103
- # ipykernel
104
- # ipywidgets
105
- # jupyter-console
106
- ipython==9.10.1 ; python_full_version == '3.11.*'
107
- # via
108
- # ipykernel
109
- # ipywidgets
110
- # jupyter-console
111
- ipython==9.12.0 ; python_full_version >= '3.12'
112
  # via
113
  # ipykernel
114
  # ipywidgets
115
  # jupyter-console
116
- ipython-pygments-lexers==1.1.1 ; python_full_version >= '3.11'
117
  # via ipython
118
  ipywidgets==8.1.8
119
  # via
120
  # ipywidgets-bokeh
121
  # jupyter
 
122
  ipywidgets-bokeh==1.7.0
123
  # via vitis-exp-builder
124
  isoduration==20.11.0
@@ -132,7 +121,7 @@ jinja2==3.1.6
132
  # jupyterlab
133
  # jupyterlab-server
134
  # nbconvert
135
- json5==0.13.0
136
  # via jupyterlab-server
137
  jsonpointer==3.1.1
138
  # via jsonschema
@@ -145,6 +134,8 @@ jsonschema-specifications==2025.9.1
145
  # via jsonschema
146
  jupyter==1.1.1
147
  # via vitis-exp-builder
 
 
148
  jupyter-client==8.8.0
149
  # via
150
  # ipykernel
@@ -165,7 +156,7 @@ jupyter-core==5.9.1
165
  # nbformat
166
  jupyter-events==0.12.0
167
  # via jupyter-server
168
- jupyter-lsp==2.3.0
169
  # via jupyterlab
170
  jupyter-server==2.17.0
171
  # via
@@ -216,13 +207,15 @@ mdurl==0.1.2
216
  # via markdown-it-py
217
  mistune==3.2.0
218
  # via nbconvert
219
- narwhals==2.18.1
 
 
220
  # via
221
  # bokeh
222
  # panel
223
  nbclient==0.10.4
224
  # via nbconvert
225
- nbconvert==7.17.0
226
  # via
227
  # jupyter
228
  # jupyter-server
@@ -239,24 +232,16 @@ notebook-shim==0.2.4
239
  # via
240
  # jupyterlab
241
  # notebook
242
- numpy==2.2.6 ; python_full_version < '3.11'
243
  # via
244
  # bokeh
245
  # contourpy
246
  # matplotlib
247
  # pandas
248
  # vitis-exp-builder
249
- numpy==2.4.3 ; python_full_version >= '3.11'
250
- # via
251
- # bokeh
252
- # contourpy
253
- # matplotlib
254
- # pandas
255
- # vitis-exp-builder
256
- overrides==7.7.0 ; python_full_version < '3.12'
257
- # via jupyter-server
258
  packaging==26.0
259
  # via
 
260
  # bokeh
261
  # ipykernel
262
  # jupyter-events
@@ -266,11 +251,7 @@ packaging==26.0
266
  # matplotlib
267
  # nbconvert
268
  # panel
269
- pandas==2.3.3 ; python_full_version < '3.11'
270
- # via
271
- # panel
272
- # vitis-exp-builder
273
- pandas==3.0.1 ; python_full_version >= '3.11'
274
  # via
275
  # panel
276
  # vitis-exp-builder
@@ -278,20 +259,24 @@ pandocfilters==1.5.1
278
  # via nbconvert
279
  panel==1.8.10
280
  # via vitis-exp-builder
281
- param==2.3.2
282
  # via
283
  # panel
284
  # pyviz-comms
285
  parso==0.8.6
286
  # via jedi
 
 
287
  pexpect==4.9.0 ; sys_platform != 'emscripten' and sys_platform != 'win32'
288
  # via ipython
289
- pillow==12.1.1
290
  # via
291
  # bokeh
292
  # matplotlib
293
  platformdirs==4.9.4
294
- # via jupyter-core
 
 
295
  prometheus-client==0.24.1
296
  # via jupyter-server
297
  prompt-toolkit==3.0.52
@@ -308,7 +293,7 @@ pure-eval==0.2.3
308
  # via stack-data
309
  pycparser==3.0 ; implementation_name != 'PyPy'
310
  # via cffi
311
- pygments==2.19.2
312
  # via
313
  # ipython
314
  # ipython-pygments-lexers
@@ -324,10 +309,10 @@ python-dateutil==2.9.0.post0
324
  # jupyter-client
325
  # matplotlib
326
  # pandas
327
- python-json-logger==4.0.0
328
  # via jupyter-events
329
- pytz==2026.1.post1 ; python_full_version < '3.11'
330
- # via pandas
331
  pyviz-comms==3.0.6
332
  # via panel
333
  pywinpty==3.0.3 ; os_name == 'nt'
@@ -350,7 +335,7 @@ referencing==0.37.0
350
  # jsonschema
351
  # jsonschema-specifications
352
  # jupyter-events
353
- requests==2.33.0
354
  # via
355
  # jupyterlab-server
356
  # panel
@@ -386,8 +371,6 @@ terminado==0.18.1
386
  # jupyter-server-terminals
387
  tinycss2==1.4.0
388
  # via bleach
389
- tomli==2.4.1 ; python_full_version < '3.11'
390
- # via jupyterlab
391
  tornado==6.5.5
392
  # via
393
  # bokeh
@@ -416,16 +399,9 @@ traitlets==5.14.3
416
  # nbformat
417
  typing-extensions==4.15.0
418
  # via
419
- # anyio
420
- # async-lru
421
  # beautifulsoup4
422
- # exceptiongroup
423
- # ipython
424
- # mistune
425
  # panel
426
- # pypdf
427
- # referencing
428
- tzdata==2025.3
429
  # via
430
  # arrow
431
  # pandas
@@ -449,5 +425,5 @@ websocket-client==1.9.0
449
  # via jupyter-server
450
  widgetsnbextension==4.0.15
451
  # via ipywidgets
452
- xyzservices==2025.11.0
453
  # via bokeh
 
25
  # via jupyterlab-server
26
  beautifulsoup4==4.14.3
27
  # via nbconvert
28
+ black==26.3.1
29
+ # via vitis-exp-builder
30
  bleach==6.3.0
31
  # via
32
  # nbconvert
 
34
  bokeh==3.9.0
35
  # via
36
  # ipywidgets-bokeh
37
+ # jupyter-bokeh
38
  # panel
39
  certifi==2026.2.25
40
  # via
 
45
  # via
46
  # argon2-cffi-bindings
47
  # pyzmq
48
+ charset-normalizer==3.4.7
49
  # via requests
50
+ click==8.3.2
51
+ # via black
52
  colorama==0.4.6 ; sys_platform == 'win32'
53
  # via
54
+ # click
55
  # ipython
56
  # tqdm
57
  comm==0.2.3
58
  # via
59
  # ipykernel
60
  # ipywidgets
61
+ contourpy==1.3.3
 
 
 
 
62
  # via
63
  # bokeh
64
  # matplotlib
 
70
  # via ipython
71
  defusedxml==0.7.1
72
  # via nbconvert
 
 
 
 
73
  executing==2.2.1
74
  # via stack-data
75
  fastjsonschema==2.21.2
 
96
  # jupyter
97
  # jupyter-console
98
  # jupyterlab
99
+ ipython==9.12.0
 
 
 
 
 
 
 
 
 
 
100
  # via
101
  # ipykernel
102
  # ipywidgets
103
  # jupyter-console
104
+ ipython-pygments-lexers==1.1.1
105
  # via ipython
106
  ipywidgets==8.1.8
107
  # via
108
  # ipywidgets-bokeh
109
  # jupyter
110
+ # jupyter-bokeh
111
  ipywidgets-bokeh==1.7.0
112
  # via vitis-exp-builder
113
  isoduration==20.11.0
 
121
  # jupyterlab
122
  # jupyterlab-server
123
  # nbconvert
124
+ json5==0.14.0
125
  # via jupyterlab-server
126
  jsonpointer==3.1.1
127
  # via jsonschema
 
134
  # via jsonschema
135
  jupyter==1.1.1
136
  # via vitis-exp-builder
137
+ jupyter-bokeh==4.0.5
138
+ # via vitis-exp-builder
139
  jupyter-client==8.8.0
140
  # via
141
  # ipykernel
 
156
  # nbformat
157
  jupyter-events==0.12.0
158
  # via jupyter-server
159
+ jupyter-lsp==2.3.1
160
  # via jupyterlab
161
  jupyter-server==2.17.0
162
  # via
 
207
  # via markdown-it-py
208
  mistune==3.2.0
209
  # via nbconvert
210
+ mypy-extensions==1.1.0
211
+ # via black
212
+ narwhals==2.19.0
213
  # via
214
  # bokeh
215
  # panel
216
  nbclient==0.10.4
217
  # via nbconvert
218
+ nbconvert==7.17.1
219
  # via
220
  # jupyter
221
  # jupyter-server
 
232
  # via
233
  # jupyterlab
234
  # notebook
235
+ numpy==2.4.4
236
  # via
237
  # bokeh
238
  # contourpy
239
  # matplotlib
240
  # pandas
241
  # vitis-exp-builder
 
 
 
 
 
 
 
 
 
242
  packaging==26.0
243
  # via
244
+ # black
245
  # bokeh
246
  # ipykernel
247
  # jupyter-events
 
251
  # matplotlib
252
  # nbconvert
253
  # panel
254
+ pandas==3.0.2
 
 
 
 
255
  # via
256
  # panel
257
  # vitis-exp-builder
 
259
  # via nbconvert
260
  panel==1.8.10
261
  # via vitis-exp-builder
262
+ param==2.3.3
263
  # via
264
  # panel
265
  # pyviz-comms
266
  parso==0.8.6
267
  # via jedi
268
+ pathspec==1.0.4
269
+ # via black
270
  pexpect==4.9.0 ; sys_platform != 'emscripten' and sys_platform != 'win32'
271
  # via ipython
272
+ pillow==12.2.0
273
  # via
274
  # bokeh
275
  # matplotlib
276
  platformdirs==4.9.4
277
+ # via
278
+ # black
279
+ # jupyter-core
280
  prometheus-client==0.24.1
281
  # via jupyter-server
282
  prompt-toolkit==3.0.52
 
293
  # via stack-data
294
  pycparser==3.0 ; implementation_name != 'PyPy'
295
  # via cffi
296
+ pygments==2.20.0
297
  # via
298
  # ipython
299
  # ipython-pygments-lexers
 
309
  # jupyter-client
310
  # matplotlib
311
  # pandas
312
+ python-json-logger==4.1.0
313
  # via jupyter-events
314
+ pytokens==0.4.1
315
+ # via black
316
  pyviz-comms==3.0.6
317
  # via panel
318
  pywinpty==3.0.3 ; os_name == 'nt'
 
335
  # jsonschema
336
  # jsonschema-specifications
337
  # jupyter-events
338
+ requests==2.33.1
339
  # via
340
  # jupyterlab-server
341
  # panel
 
371
  # jupyter-server-terminals
372
  tinycss2==1.4.0
373
  # via bleach
 
 
374
  tornado==6.5.5
375
  # via
376
  # bokeh
 
399
  # nbformat
400
  typing-extensions==4.15.0
401
  # via
 
 
402
  # beautifulsoup4
 
 
 
403
  # panel
404
+ tzdata==2026.1
 
 
405
  # via
406
  # arrow
407
  # pandas
 
425
  # via jupyter-server
426
  widgetsnbextension==4.0.15
427
  # via ipywidgets
428
+ xyzservices==2026.3.0
429
  # via bokeh
uv.lock CHANGED
The diff for this file is too large to render. See raw diff