Skip to content

Commit

Permalink
Fixed CI by updating black and increasing error threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
ramenguy99 committed Mar 9, 2024
1 parent 23fe0a0 commit e19a7e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions aitviewer/utils/bvh.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import re

import numpy as np
Expand Down
7 changes: 6 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from aitviewer.configuration import CONFIG as C
from aitviewer.headless import HeadlessRenderer

# Check if running on github CI.
CI = os.getenv("GITHUB_ACTIONS") == "true"

# Test image size.
SIZE = (480, 270)

Expand Down Expand Up @@ -67,8 +70,10 @@ def viewer(refs):
diff = ImageChops.difference(img, ref_img)
relative_error = np.asarray(diff).sum() / np.full(np.asarray(img).shape, 255).sum()

relative_error_threshold = 3e-3 if not CI else 2e-2

# If the relative error is higher than this threshold report a failure.
if relative_error > 3e-3:
if relative_error > relative_error_threshold:
os.makedirs(FAILURE_DIR, exist_ok=True)

# Store the wrong result and diff for debugging.
Expand Down

0 comments on commit e19a7e4

Please sign in to comment.