Skip to content

Improves github actions #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/check_urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Check URLs

on:
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: urls-checker-code
uses: urlstechie/urlchecker-action@master
with:
subfolder: onnx_array_api
file_types: .md,.py,.rst,.ipynb
print_all: false
timeout: 2
retry_count# : 2
# exclude_urls: https://dumps.wikimedia.org/other/pageviews/%Y/%Y-%m/pageviews-%Y%m%d-%H0000.gz,https://dumps.wikimedia.org/frwiki/latest/latest-all-titles-in-ns0.gz
exclude_patterns: https://dumps.wikimedia.org/
# force_pass : true

- name: urls-checker-docs
uses: urlstechie/urlchecker-action@master
with:
subfolder: _doc
file_types: .md,.py,.rst,.ipynb
print_all: false
timeout: 2
retry_count# : 2
exclude_urls: https://hal.archives-ouvertes.fr/hal-00990252/document
exclude_patterns: https://www.data.gouv.fr/fr/datasets/r/e3d83ab3-dc52-4c99-abaf-8a38050cc68c,https://dev.azure.com/
# force_pass : true
75 changes: 57 additions & 18 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
name: Documentation
name: Documentation and Code Coverage

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'
types:
- closed
branches:
- main

jobs:
build_wheels:
run:
name: Build documentation on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -33,17 +24,65 @@ jobs:
with:
python-version: '3.11'

- uses: tlylt/install-graphviz@v1

- name: Install pandoc
run: sudo apt-get install -y pandoc

- name: Install requirements
run: python -m pip install -r requirements.txt

- name: Install requirements-dev.txt
- name: Install requirements dev
run: python -m pip install -r requirements-dev.txt

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
export PYTHONPATH=.
pytest --cov=./onnx_array_api/ --cov-report=xml --durations=10 --ignore-glob=**LONG*.py --ignore-glob=**notebook*.py
export PYTHONPATH=

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Install
run: python -m pip install -e .
run: python setup.py install

- name: Copy license, changelogs
run: |
cp LICENSE* ./_doc
cp CHANGELOGS* ./_doc

- name: Documentation
run: python -m sphinx ./_doc ./dist/html
run: python -m sphinx ./_doc ./dist/html -n -w doc.txt

- name: Summary
run: cat doc.txt

- name: Check for errors and warnings
run: |
if [[ $(grep ERROR doc.txt) ]]; then
echo "Documentation produces errors."
grep ERROR doc.txt
exit 1
fi
if [[ $(grep WARNING doc.txt) ]]; then
echo "Documentation produces warnings."
grep WARNING doc.txt
exit 1
fi

- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOGS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Change Logs
an array to a TensorProto, including bfloat16 and float 8 types
* :pr:`24`: add ExtendedReferenceEvaluator to support scenario
for the Array API onnx does not support
* :pr:`22`: support OrtValue in function :func:`ort_profile`
* :pr:`22`: support OrtValue in function *ort_profile*
* :pr:`17`: implements ArrayAPI
* :pr:`3`: fixes Array API with onnxruntime and scikit-learn
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ onnx-array-api: (Numpy) Array API for ONNX
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://codecov.io/gh/sdpython/onnx-array-api/branch/main/graph/badge.svg?token=Wb9ZGDta8J
:target: https://codecov.io/gh/sdpython/onnx-array-api

**onnx-array-api** implements a numpy API for ONNX.
It gives the user the ability to convert functions written
following the numpy API to convert that function into ONNX as
Expand Down
5 changes: 3 additions & 2 deletions _doc/api/array_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ onnx_array_api.array_api

.. toctree::

array_api_onnx_numpy
array_api_onnx_ort
array_api_numpy
array_api_ort
npx_array_api
5 changes: 4 additions & 1 deletion _doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ API
:maxdepth: 1

array_api
npx_core_api
npx_functions
npx_jit
npx_jit_eager
npx_numpy
npx_tensors
npx_types
npx_var
onnx_tools
ort
plotting
reference
tools
profiling
5 changes: 5 additions & 0 deletions _doc/api/npx_array_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
onnx_array_api.npx.npx_array_api
================================

.. automodule:: onnx_array_api.npx.npx_array_api.BaseArrayApi
:members:
36 changes: 19 additions & 17 deletions _doc/api/npx_jit.rst → _doc/api/npx_core_api.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
npx, jit and eager mode
=======================
============
npx_core_api
============


API
+++

.. autofunction:: onnx_array_api.npx.npx_core_api.var
cst
===

.. autofunction:: onnx_array_api.npx.npx_core_api.cst

.. autofunction:: onnx_array_api.npx.npx_jit_eager.eager_onnx

.. autofunction:: onnx_array_api.npx.npx_jit_eager.jit_onnx
make_tuple
==========

.. autofunction:: onnx_array_api.npx.npx_core_api.make_tuple

tuple_var
=========

.. autofunction:: onnx_array_api.npx.npx_core_api.tuple_var

npxapi_inline
=============

.. autofunction:: onnx_array_api.npx.npx_core_api.npxapi_inline

.. autofunction:: onnx_array_api.npx.npx_core_api.npxapi_function
npxapi_function
===============

JIT, Eager
++++++++++
.. autofunction:: onnx_array_api.npx.npx_core_api.npxapi_function

.. autoclass:: onnx_array_api.npx.npx_jit_eager.JitEager
:members:
var
===

.. autoclass:: onnx_array_api.npx.npx_jit_eager.JitOnnx
:members:
.. autofunction:: onnx_array_api.npx.npx_core_api.var
31 changes: 31 additions & 0 deletions _doc/api/npx_jit_eager.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
=============
npx_jit_eager
=============

eager_onnx
==========

.. autofunction:: onnx_array_api.npx.npx_jit_eager.eager_onnx

EagerOnnx
=========

.. autoclass:: onnx_array_api.npx.npx_jit_eager.EagerOnnx
:members:

JitEager
========

.. autoclass:: onnx_array_api.npx.npx_jit_eager.JitEager
:members:

jit_onnx
========

.. autofunction:: onnx_array_api.npx.npx_jit_eager.jit_onnx

JitOnnx
=======

.. autoclass:: onnx_array_api.npx.npx_jit_eager.JitOnnx
:members:
9 changes: 9 additions & 0 deletions _doc/api/npx_numpy.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
npx.npx_numpy_tensors
=====================

EagerNumpyTensor
++++++++++++++++

.. autoclass:: onnx_array_api.npx.npx_numpy_tensors.EagerNumpyTensor
:members:

JitNumpyTensor
++++++++++++++

.. autoclass:: onnx_array_api.npx.npx_numpy_tensors.JitNumpyTensor
:members:

NumpyTensor
+++++++++++

.. autoclass:: onnx_array_api.npx.npx_numpy_tensors.NumpyTensor
:members:
10 changes: 10 additions & 0 deletions _doc/api/npx_tensors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===========
npx_tensors
===========


EagerTensor
===========

.. autoclass:: onnx_array_api.npx.npx_tensors.EagerTensor
:members:
22 changes: 15 additions & 7 deletions _doc/api/ort.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
ort
===

Optimization
++++++++++++
ort_optimized_model
+++++++++++++++++++

.. autofunction:: onnx_array_api.ort.ort_optimizers.ort_optimized_model

OrtTensor
+++++++++
EagerOrtTensor
++++++++++++++

.. autoclass:: onnx_array_api.ort.ort_tensors.EagerOrtTensor
:members:

JitOrtTensor
++++++++++++

.. autoclass:: onnx_array_api.ort.ort_tensors.JitOrtTensor
:members:

OrtTensor
+++++++++

.. autoclass:: onnx_array_api.ort.ort_tensors.OrtTensor
:members:

Profiling
+++++++++
merge_ort_profile
+++++++++++++++++

.. autofunction:: onnx_array_api.ort.ort_profile.merge_ort_profile

.. autofunction:: onnx_array_api.ort.ort_profile.ort_profile
ort_profile
+++++++++++

.. autofunction:: onnx_array_api.ort.ort_profile.ort_profile
17 changes: 17 additions & 0 deletions _doc/api/profiling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
profiling
=========

ProfileNode
+++++++++++

.. autoclass:: onnx_array_api.profiling.ProfileNode

profile
+++++++

.. autofunction:: onnx_array_api.profiling.profile

profile2graph
+++++++++++++

.. autofunction:: onnx_array_api.profiling.profile2graph
10 changes: 0 additions & 10 deletions _doc/api/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ Examples

.. autofunction:: onnx_array_api.ext_test_case.example_path

Profiling
+++++++++

.. autofunction:: onnx_array_api.profiling.profile

.. autofunction:: onnx_array_api.profiling.profile2graph

.. autofunction:: onnx_array_api.profiling.profile2df


Unit tests
++++++++++

Expand Down
Loading