Skip to content

Commit b46edf0

Browse files
authored
chore: Reduce package deps, improve install and import time (wandb#1144)
* Simplify intro again * Start of remove package deps refactor * Down to 204 failures * Fix more tests * Fix more tests * More test fixes * Fix test * Fixes * Add import safety check * Refactor: split arrow from ops_arrow * Fix unit tests * Fix more tests. * Remove unneeded import * Fix tests. * fix node_ref test * Fix lint * Disable test * Disable test * Fix package * Remove extra file * Fix notebook test * make panels render in notebooks * Fix notebook * Fix a few notebooks * Fix another notebook * Fix synced axes notebook * Fix broken panel rendering and add test back * Fix some notebook tests, remove others * Notebook auto-lint * Simplify requirements for weaveflow * Fix WB_API notebook * Fix notebook * Fix scatter notebook * Update other requirements to point to engine * Fix confusion matrix test * Fix requirements structure * Fix autoboards and notebook test * Clean up * Empty-Commit
1 parent 4c7ffdc commit b46edf0

File tree

149 files changed

+1048
-1751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1048
-1751
lines changed

.pre-commit-config.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ repos:
1616
- id: mypy
1717
additional_dependencies: [types-all, wandb>=0.15.5]
1818
exclude: .*pyi$
19-
- repo: https://github.com/RobertCraigie/pyright-python
20-
rev: v1.1.341
21-
hooks:
22-
- id: pyright
19+
# Turn pyright back off, duplicative of mypy
20+
# - repo: https://github.com/RobertCraigie/pyright-python
21+
# rev: v1.1.341
22+
# hooks:
23+
# - id: pyright
2324
- repo: local
2425
hooks:
2526
- id: jupyter-nb-clear-output

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ENV PORT 9239
4242
WORKDIR /weave
4343
ADD . .
4444

45-
RUN pip install -r requirements.txt
45+
RUN pip install -r requirements.engine.txt
4646
RUN mkdir /local-artifacts
4747

4848
EXPOSE 9239

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include requirements.*
22
include wb_schema.gql
3+
graft weave/arrow
34
graft weave/frontend
45
graft weave/language_features
56
graft weave/ops_primitives

examples/experimental/01 Tutorial - Operations.ipynb

-98
This file was deleted.

examples/experimental/Closures.ipynb

+48-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"cell_type": "code",
55
"execution_count": null,
66
"id": "69440036",
7-
"metadata": {},
7+
"metadata": {
8+
"execution": {
9+
"iopub.execute_input": "2024-01-27T16:44:14.261867Z",
10+
"iopub.status.busy": "2024-01-27T16:44:14.261748Z",
11+
"iopub.status.idle": "2024-01-27T16:44:15.442511Z",
12+
"shell.execute_reply": "2024-01-27T16:44:15.442129Z"
13+
}
14+
},
815
"outputs": [],
916
"source": [
1017
"import weave\n",
@@ -16,7 +23,14 @@
1623
"cell_type": "code",
1724
"execution_count": null,
1825
"id": "a7f7eda3",
19-
"metadata": {},
26+
"metadata": {
27+
"execution": {
28+
"iopub.execute_input": "2024-01-27T16:44:15.444502Z",
29+
"iopub.status.busy": "2024-01-27T16:44:15.444298Z",
30+
"iopub.status.idle": "2024-01-27T16:44:15.448977Z",
31+
"shell.execute_reply": "2024-01-27T16:44:15.448714Z"
32+
}
33+
},
2034
"outputs": [],
2135
"source": [
2236
"x = 7\n",
@@ -30,7 +44,14 @@
3044
"cell_type": "code",
3145
"execution_count": null,
3246
"id": "e36d5f49",
33-
"metadata": {},
47+
"metadata": {
48+
"execution": {
49+
"iopub.execute_input": "2024-01-27T16:44:15.450446Z",
50+
"iopub.status.busy": "2024-01-27T16:44:15.450342Z",
51+
"iopub.status.idle": "2024-01-27T16:44:15.452299Z",
52+
"shell.execute_reply": "2024-01-27T16:44:15.452049Z"
53+
}
54+
},
3455
"outputs": [],
3556
"source": [
3657
"print(add_to_closed_var.resolve_fn.__closure__)"
@@ -40,7 +61,14 @@
4061
"cell_type": "code",
4162
"execution_count": null,
4263
"id": "287a502c",
43-
"metadata": {},
64+
"metadata": {
65+
"execution": {
66+
"iopub.execute_input": "2024-01-27T16:44:15.453690Z",
67+
"iopub.status.busy": "2024-01-27T16:44:15.453585Z",
68+
"iopub.status.idle": "2024-01-27T16:44:19.844023Z",
69+
"shell.execute_reply": "2024-01-27T16:44:19.843685Z"
70+
}
71+
},
4472
"outputs": [],
4573
"source": [
4674
"print(weave.use(add_to_closed_var(9)))"
@@ -50,7 +78,14 @@
5078
"cell_type": "code",
5179
"execution_count": null,
5280
"id": "64f7c176",
53-
"metadata": {},
81+
"metadata": {
82+
"execution": {
83+
"iopub.execute_input": "2024-01-27T16:44:19.845702Z",
84+
"iopub.status.busy": "2024-01-27T16:44:19.845472Z",
85+
"iopub.status.idle": "2024-01-27T16:44:19.849105Z",
86+
"shell.execute_reply": "2024-01-27T16:44:19.848830Z"
87+
}
88+
},
5489
"outputs": [],
5590
"source": [
5691
"outer_var = 1\n",
@@ -69,7 +104,14 @@
69104
"cell_type": "code",
70105
"execution_count": null,
71106
"id": "4f01dcf4",
72-
"metadata": {},
107+
"metadata": {
108+
"execution": {
109+
"iopub.execute_input": "2024-01-27T16:44:19.850537Z",
110+
"iopub.status.busy": "2024-01-27T16:44:19.850451Z",
111+
"iopub.status.idle": "2024-01-27T16:44:19.854527Z",
112+
"shell.execute_reply": "2024-01-27T16:44:19.854126Z"
113+
}
114+
},
73115
"outputs": [],
74116
"source": [
75117
"outer_var = 1\n",

examples/experimental/Monitor.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"# Weave package now defaults to eager mode, but lazy mode required for this example notebook for now.\n",
2323
"weave.use_lazy_execution()\n",
2424
"from weave import syndata_mon\n",
25-
"from weave.ops_arrow.list_ import dataframe_to_arrow\n",
25+
"from weave.arrow.list_ import dataframe_to_arrow\n",
2626
"from weave.ecosystem import wandb"
2727
]
2828
},

examples/experimental/MonitorPanelPlot.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"outputs": [],
1919
"source": [
2020
"import weave\n",
21-
"weave.use_frontend_devmode()\n",
21+
"import weave.panels\n",
2222
"weave.use_lazy_execution()\n",
2323
"from weave import syndata_mon"
2424
]

examples/experimental/image_gen_ops.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"import numpy as np\n",
1414
"import matplotlib.pyplot as plt\n",
1515
"import random\n",
16+
"from weave import ops\n",
1617
"\n",
1718
"def plt_image():\n",
1819
" \"\"\"Return current matplotlib figure as PIL Image\"\"\"\n",
@@ -117,7 +118,7 @@
117118
"name": "python",
118119
"nbconvert_exporter": "python",
119120
"pygments_lexer": "ipython3",
120-
"version": "3.10.8"
121+
"version": "3.9.7"
121122
}
122123
},
123124
"nbformat": 4,

examples/experimental/inference_logs.ipynb

-71
This file was deleted.

examples/experimental/object_version_compare.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"plot = weave.panels.Plot(points,\n",
5858
" x=lambda row: row['x'],\n",
5959
" y=lambda row: row['y'])\n",
60-
"weave.show(plot)\n",
60+
"plot\n",
6161
"\n",
6262
"# NOTE! There is a UI bug here. You need to click the gear icon and\n",
6363
"# then \"Reset & Automate Plot\" -> \"OK\" to make it render correctly"

examples/experimental/table_data_passing.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"outputs": [],
99
"source": [
1010
"import weave\n",
11+
"import weave.panels\n",
1112
"# Weave package now defaults to eager mode, but lazy mode required for this example notebook for now.\n",
1213
"weave.use_lazy_execution()"
1314
]

examples/get_started.ipynb

+5-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
"outputs": [],
7777
"source": [
7878
"import weave\n",
79-
"weave.show(iris_df)"
79+
"from weave.show import show\n",
80+
"show(iris_df)"
8081
]
8182
},
8283
{
@@ -129,7 +130,7 @@
129130
"metadata": {},
130131
"outputs": [],
131132
"source": [
132-
"weave.show(iris_df)"
133+
"show(iris_df)"
133134
]
134135
},
135136
{
@@ -205,7 +206,7 @@
205206
"metadata": {},
206207
"outputs": [],
207208
"source": [
208-
"weave.show(iris_df)"
209+
"show(iris_df)"
209210
]
210211
},
211212
{
@@ -251,7 +252,7 @@
251252
" imarray = numpy.random.rand(100,100,3) * 255\n",
252253
" return Image.fromarray(imarray.astype('uint8')).convert('RGBA')\n",
253254
"\n",
254-
"weave.show([{'image_col': random_image(), 'text_col': 'Hello'}, \n",
255+
"show([{'image_col': random_image(), 'text_col': 'Hello'}, \n",
255256
" {'image_col': random_image(), 'text_col': 'World'}]*1000)"
256257
]
257258
},

0 commit comments

Comments
 (0)