Skip to content

Commit 39e7283

Browse files
authored
Exclude OCC import from lite deployment (#693)
* Separate out occ notebook * only include Notebook.ipynb in lite deployment
1 parent 560a1ef commit 39e7283

File tree

3 files changed

+75
-50
lines changed

3 files changed

+75
-50
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ jobs:
244244
working-directory: lite
245245
run: |
246246
set -eux
247-
mkdir -p content && cp ../examples/*.jcad ../examples/*.STEP ../examples/*.stl ../examples/*.ipynb ./content
247+
mkdir -p content && cp ../examples/*.jcad ../examples/*.STEP ../examples/*.stl ../examples/Notebook.ipynb ./content
248248
jupyter lite build --contents content --output-dir dist
249249
250250
- name: Upload github-pages artifact

examples/Notebook.ipynb

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -146,54 +146,6 @@
146146
"doc"
147147
]
148148
},
149-
{
150-
"cell_type": "markdown",
151-
"id": "a2874026-07eb-4d92-b660-cc68606c0664",
152-
"metadata": {},
153-
"source": [
154-
"#### Create a shape from the Open Cascade Python API"
155-
]
156-
},
157-
{
158-
"cell_type": "code",
159-
"execution_count": null,
160-
"id": "9f587854-329d-41b4-8c61-7fc1bf930811",
161-
"metadata": {},
162-
"outputs": [],
163-
"source": [
164-
"from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox\n",
165-
"\n",
166-
"from jupytercad import CadDocument\n",
167-
"\n",
168-
"doc = CadDocument()\n",
169-
"\n",
170-
"box_shape = BRepPrimAPI_MakeBox(10, 20, 30).Shape()\n",
171-
"\n",
172-
"doc.add_occ_shape(box_shape)\n",
173-
"\n",
174-
"doc"
175-
]
176-
},
177-
{
178-
"cell_type": "code",
179-
"execution_count": null,
180-
"id": "bb94973f-3b9e-4652-9f46-5070f6bd2583",
181-
"metadata": {},
182-
"outputs": [],
183-
"source": [
184-
"from OCC.Extend.DataExchange import read_stl_file\n",
185-
"\n",
186-
"wheel = read_stl_file(\"fan.stl\")\n",
187-
"\n",
188-
"from jupytercad import CadDocument\n",
189-
"\n",
190-
"doc = CadDocument()\n",
191-
"\n",
192-
"doc.add_occ_shape(wheel)\n",
193-
"\n",
194-
"doc"
195-
]
196-
},
197149
{
198150
"cell_type": "markdown",
199151
"id": "679bd8dd-9bbf-4ecf-a676-32e8137992d1",
@@ -254,7 +206,7 @@
254206
"name": "python",
255207
"nbconvert_exporter": "python",
256208
"pygments_lexer": "ipython3",
257-
"version": "3.13.1"
209+
"version": "3.12.0"
258210
}
259211
},
260212
"nbformat": 4,

examples/occ.ipynb

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "1b5296d7-deca-4359-a786-f47aae3306b7",
6+
"metadata": {},
7+
"source": [
8+
"### Create a shape from the Open Cascade Python API"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": null,
14+
"id": "c5104716-9ab3-43bb-a51c-72839264af8a",
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox\n",
19+
"\n",
20+
"from jupytercad import CadDocument\n",
21+
"\n",
22+
"doc = CadDocument()\n",
23+
"\n",
24+
"box_shape = BRepPrimAPI_MakeBox(10, 20, 30).Shape()\n",
25+
"\n",
26+
"doc.add_occ_shape(box_shape)\n",
27+
"\n",
28+
"doc"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": null,
34+
"id": "f9e68531-e53e-4265-bff8-ef9e8191b384",
35+
"metadata": {},
36+
"outputs": [],
37+
"source": [
38+
"from OCC.Extend.DataExchange import read_stl_file\n",
39+
"\n",
40+
"wheel = read_stl_file(\"fan.stl\")\n",
41+
"\n",
42+
"from jupytercad import CadDocument\n",
43+
"\n",
44+
"doc = CadDocument()\n",
45+
"\n",
46+
"doc.add_occ_shape(wheel)\n",
47+
"\n",
48+
"doc"
49+
]
50+
}
51+
],
52+
"metadata": {
53+
"kernelspec": {
54+
"display_name": "Python 3 (ipykernel)",
55+
"language": "python",
56+
"name": "python3"
57+
},
58+
"language_info": {
59+
"codemirror_mode": {
60+
"name": "ipython",
61+
"version": 3
62+
},
63+
"file_extension": ".py",
64+
"mimetype": "text/x-python",
65+
"name": "python",
66+
"nbconvert_exporter": "python",
67+
"pygments_lexer": "ipython3",
68+
"version": "3.12.0"
69+
}
70+
},
71+
"nbformat": 4,
72+
"nbformat_minor": 5
73+
}

0 commit comments

Comments
 (0)