Skip to content

Commit

Permalink
fix dot
Browse files Browse the repository at this point in the history
Signed-off-by: xadupre <[email protected]>
  • Loading branch information
xadupre committed Sep 4, 2024
1 parent 034b38b commit 7f909d2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
sklearn_version: ['==1.5.0', '==1.4.2', '==1.3.2', '==1.2.2', '==1.1.3']
include:
- sklearn_version: '==1.5.0'
documentation: 0
documentation: 1
numpy_version: '>=1.21.1,<2.0'
scipy_version: '>=1.7.0'
onnx_version: 'onnx==1.16.0'
Expand All @@ -24,7 +24,7 @@ jobs:
onnxrt_version: 'onnxruntime==1.18.1'
sklearn_version: '==1.4.2'
- python_version: '3.11'
documentation: 1
documentation: 0
numpy_version: '>=1.21.1,<2.0'
scipy_version: '>=1.7.0'
onnx_version: 'onnx<1.16.0'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build/

# test generated files
*.onnx
*.dot*
*.whl
.pytest_cache
.cache
Expand Down
25 changes: 16 additions & 9 deletions docs/examples/plot_convert_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,22 @@ def to_onnx_operator(

from onnx.tools.net_drawer import GetPydotGraph, GetOpNodeProducer

pydot_graph = GetPydotGraph(
onx.graph,
name=onx.graph.name,
rankdir="TB",
node_producer=GetOpNodeProducer(
"docstring", color="yellow", fillcolor="yellow", style="filled"
),
)
pydot_graph.write_dot("pipeline_onnx_mixin.dot")
try:
pydot_graph = GetPydotGraph(
onx.graph,
name=onx.graph.name,
rankdir="TB",
node_producer=GetOpNodeProducer(
"docstring", color="yellow", fillcolor="yellow", style="filled"
),
)
pydot_graph.write_dot("pipeline_onnx_mixin.dot")
except AssertionError:
print("GetPydotGraph failed to produce a valid DOT graph. Trying something else.")
from onnx_array_api.plotting.dot_plot import to_dot

with open("pipeline_onnx_mixin.dot", "w", encoding="utf-8") as f:
f.write(to_dot(onx))

import os

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ matplotlib
mlinsights>=0.3.631
nbsphinx
onnx
onnx-array-api
onnxmltools
onnxruntime
pillow
Expand Down

0 comments on commit 7f909d2

Please sign in to comment.