Skip to content

Commit cf20c49

Browse files
xadupreshauheen
authored andcommitted
add continuous integration, fix missing files, add badges to main pages (#2)
* add appveyor configuration * fix missing dependencies for pytest * add coremltools * travis + fix coremltools (windows) * update dependencies * add scipy * fix dependencies, add missing files * update ci scripts * fix appveyor, travis, add circleci * add badge, fix unit test scripts * disable circlecli * add coverage (token should be changed) * update appveyor command line * remove unneeded file, update command line appveyor * replace one assert by an exception, update command lines * update travis appveyor buid * fix appveyor python path * uplaod coverage report, update readme with badges * update test data * update onnx model * update unit test file * update readme * update readme
1 parent 217dbab commit cf20c49

20 files changed

+116
-4
lines changed

.appveyor.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
environment:
2+
3+
global:
4+
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
5+
# /E:ON and /V:ON options are not enabled in the batch script intepreter
6+
# See: http://stackoverflow.com/a/13751649/163740
7+
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_compiler.cmd"
8+
9+
matrix:
10+
11+
- PYTHON: "C:\\Python36-x64"
12+
PYTHON_VERSION: "3.6.x"
13+
PYTHON_ARCH: "64"
14+
15+
init:
16+
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
17+
18+
install:
19+
- "%PYTHON%\\python -m pip install --upgrade pip"
20+
- "%PYTHON%\\Scripts\\pip install -r requirements.txt"
21+
- "%PYTHON%\\Scripts\\pip install git+https://github.com/apple/coremltools"
22+
- "%PYTHON%\\Scripts\\pip install https://github.com/xadupre/xgboost/releases/download/0.7/xgboost-0.7-cp36-cp36m-win_amd64.whl"
23+
- "%PYTHON%\\Scripts\\pip install -r requirements-dev.txt"
24+
- set PYTHONPATH=%~dp0
25+
26+
build: off
27+
28+
test_script:
29+
- "%PYTHON%\\python -m pytest --cov=onnxmltools --cov-report=term --cov-report=html --cov-report=xml tests"
30+
31+
after_test:
32+
- "%PYTHON%\\python -u setup.py bdist_wheel"
33+
- if not exist dist mkdir dist
34+
- if not exist dist\htmlcov mkdir dist\htmlcov
35+
- xcopy htmlcov dist\htmlcov
36+
- copy *.xml dist\htmlcov
37+
- if %APPVEYOR_ACCOUNT_NAME%==xadupre %PYTHON%\Scripts\codecov -f coverage.xml -t 2c916354-0f91-46b4-a577-f80b0031c941
38+
39+
artifacts:
40+
- path: dist
41+
name: onnxmltools
42+

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = tests/*

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Visual Studio Code files
2+
.vscode
3+
4+
# IPython notebook checkpoints
5+
.ipynb_checkpoints
6+
7+
# Compiled python
8+
*.pyc
9+
10+
# setup.py intermediates
11+
.eggs
12+
dist
13+
14+
# PyCharm files
15+
.idea
16+
17+
# OSX dir files
18+
.DS_Store
19+
20+
# Windows
21+
*.bat
22+
23+
# test generated files
24+
.pytest_cache
25+
.cache
26+
tests/utils/models/coreml_OneHotEncoder_BikeSharing_new.json
27+
tests/utils/models/coreml_OneHotEncoder_BikeSharing2.onnx
28+
tests/baseline/outmodels
29+
htmlcov
30+
coverage.xml
31+
.coverage

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
dist: trusty
2+
language: python
3+
python:
4+
- "3.5"
5+
- "3.6"
6+
install:
7+
- pip install -r requirements.txt
8+
- pip install -r requirements-dev.txt
9+
- export PYTHONPATH=pwd
10+
script:
11+
- python -m pytest --cov=onnxmltools --cov-report=term --cov-report=html --cov-report=xml tests
12+

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<p align="center"><img width="40%" src="docs/ONNXMLTools_logo_main.png" /></p>
22

3+
| Linux | Windows |
4+
|-------|---------|
5+
| [![Build Status](https://travis-ci.org/onnx/onnxmltools.svg?branch=master)](https://travis-ci.org/onnx/onnxmltools) | [![Build status](https://ci.appveyor.com/api/projects/status/d1xav3amubypje4n?svg=true)](https://ci.appveyor.com/project/xadupre/onnxmltools) |
6+
7+
38
# Introduction
49
ONNXMLTools enables you to convert models from different machine learning toolkits into [ONNX](https://onnx.ai). Currently the following toolkits are supported:
510
* Apple CoreML

README.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11

22
.. image:: https://github.com/onnx/onnxmltools/blob/master/docs/ONNXMLTools_logo_main.png
3-
3+
4+
.. list-table::
5+
:widths: 4 4
6+
:header-rows: 0
7+
8+
* - .. image:: https://travis-ci.org/onnx/onnxmltools.svg?branch=master
9+
:target: https://travis-ci.org/onnx/onnxmltools
10+
:alt: Build Status Linux
11+
- .. image:: https://ci.appveyor.com/api/projects/status/d1xav3amubypje4n?svg=true
12+
:target: https://ci.appveyor.com/project/xadupre/onnxmltools
13+
:alt: Build Status Windows
14+
415
Introduction
516
============
617

@@ -31,7 +42,6 @@ Example
3142

3243
Here is a simple example to convert a CoreML model:
3344

34-
3545
::
3646

3747
import onnxmltools

onnxmltools/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

onnxmltools/convert/coreml/TreeConverterCommon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def convert(context, cm_node, inputs, outputs, prefix):
8484
nb.add_attribute('base_values', cm_node.treeEnsembleRegressor.treeEnsemble.basePredictionValue)
8585
post_transform = get_onnx_tree_post_transform(cm_node.treeEnsembleRegressor.postEvaluationTransform)
8686
else:
87-
assert (False, "Unknown tree type!")
87+
raise TypeError("Unknown tree type: prefix='{0}'".format(prefix))
8888

8989
leaf_treeids = [node.treeId for node in nodes if 6 == node.nodeBehavior for weight in node.evaluationInfo]
9090
leaf_nodeids = [node.nodeId for node in nodes if 6 == node.nodeBehavior for weight in node.evaluationInfo]

requirements-dev.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
codecov
2+
coremltools
3+
pandas
4+
pytest
5+
pytest-cov
6+
scikit-learn
7+
scipy
8+
wheel
9+
xgboost
10+
11+

0 commit comments

Comments
 (0)