Skip to content

Commit

Permalink
Merge branch 'main' into dev/torch2
Browse files Browse the repository at this point in the history
  • Loading branch information
HansBug committed Aug 10, 2023
2 parents 63ded6e + c7920bd commit 88705f3
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 14 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/test.yml
Expand Up @@ -7,6 +7,7 @@ on:
- dev/*
- fix/*
- test/*
workflow_dispatch:

jobs:
unittest:
Expand All @@ -29,7 +30,17 @@ jobs:
torch-version:
- '1.7.1'
- '1.13.1'
- '2.0.1'
- 'latest'
exclude:
- python-version: '3.7'
torch-version: '2.0.1'
- python-version: '3.10'
torch-version: '1.7.1'
- python-version: '3.11'
torch-version: '1.7.1'
- python-version: '3.11'
torch-version: '1.13.1'

steps:
- name: Get system version for Linux
Expand Down Expand Up @@ -98,16 +109,15 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-build.txt
pip install -r requirements-test.txt
- name: Install Extra Test Requirements
shell: bash
run: |
pip install -r requirements-test-extra.txt
- name: Install Torch
shell: bash
if: ${{ matrix.torch-version != 'latest' }}
continue-on-error: true
run: |
pip install torch==${{ matrix.torch-version }}
- name: Install Extra Test Requirements
shell: bash
run: |
pip install -r requirements-test-extra.txt
- name: Test the basic environment
shell: bash
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -1213,4 +1213,5 @@ fabric.properties
!/docs/source/_static/**/*
!/runs/artifacts
/runs/artifacts/*
.benchmarks
.benchmarks
/venv*
3 changes: 2 additions & 1 deletion requirements-build.txt
@@ -1,3 +1,4 @@
cython>=0.29
cython>=0.29; platform_system != 'Windows'
cython>=0.29,<3; platform_system == 'Windows'
build>=0.7.0
auditwheel>=4
2 changes: 1 addition & 1 deletion requirements-test-extra.txt
@@ -1,2 +1,2 @@
jax[cpu]>=0.3.25; platform_system != 'Windows'
torch>=1.1.0; python_version < '3.11'
torch>=1.1.0; python_version < '3.12'
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -2,4 +2,4 @@ enum_tools
graphviz>=0.17
dill>=0.3.4
click>=7.1.0
hbutils>=0.0.1
hbutils>=0.9.1
14 changes: 10 additions & 4 deletions test/tree/tree/base.py
Expand Up @@ -758,7 +758,9 @@ def test_repr_svg(self):

_repr_svg_ = t1._repr_svg_()
assert isinstance(_repr_svg_, str)
assert 4500 <= len(_repr_svg_) <= 4900
min_size, max_size = 4500, 4900
assert min_size <= len(_repr_svg_) <= max_size, \
f'Size within [{min_size!r}, {max_size!r}] required, but {len(_repr_svg_)!r} found.'

@unittest.skipUnless(cmdv('dot'), 'Dot installed only')
def test_repr_png(self):
Expand All @@ -768,9 +770,11 @@ def test_repr_png(self):
_repr_png_ = t1._repr_png_()
assert isinstance(_repr_png_, bytes)
if OS.windows:
assert 12000 <= len(_repr_png_) <= 16050
min_size, max_size = 14000, 18050
else:
assert 16050 <= len(_repr_png_) <= 20500
min_size, max_size = 16050, 20500
assert min_size <= len(_repr_png_) <= max_size, \
f'Size within [{min_size!r}, {max_size!r}] required, but {len(_repr_png_)!r} found.'

@unittest.skipUnless(cmdv('dot'), 'Dot installed only')
def test_repr_jpeg(self):
Expand All @@ -779,6 +783,8 @@ def test_repr_jpeg(self):

_repr_jpeg_ = t1._repr_jpeg_()
assert isinstance(_repr_jpeg_, bytes)
assert 10500 <= len(_repr_jpeg_) <= 14500
min_size, max_size = 10500, 14500
assert min_size <= len(_repr_jpeg_) <= max_size, \
f'Size within [{min_size!r}, {max_size!r}] required, but {len(_repr_jpeg_)!r} found.'

return _TestClass
2 changes: 1 addition & 1 deletion treevalue/config/meta.py
Expand Up @@ -7,7 +7,7 @@
__TITLE__ = "treevalue"

#: Version of this project.
__VERSION__ = "1.4.10"
__VERSION__ = "1.4.11"

#: Short description of the project, will be included in ``setup.py``.
__DESCRIPTION__ = 'A flexible, generalized tree-based data structure.'
Expand Down

0 comments on commit 88705f3

Please sign in to comment.