Skip to content

Commit

Permalink
WIP ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Amirhessam Tahmassebi committed Dec 26, 2022
1 parent 4b30e86 commit f14321e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ title: "[BUG]: "
labels: ["bug"]
assignees:
- amirhessam88
- Tsmith5151
- richardNam
- mkohram
- b-mohebali
- nicholasjma
body:
- type: markdown
attributes:
Expand Down
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ title: "[FEATURE]: "
labels: ["enhancement"]
assignees:
- amirhessam88
- Tsmith5151
- richardNam
- mkohram
- b-mohebali
- nicholasjma
body:
- type: markdown
attributes:
Expand Down
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/improve_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ title: "[DOCUMENTATION]: "
labels: ["documentation"]
assignees:
- amirhessam88
- Tsmith5151
- richardNam
- mkohram
- b-mohebali
- nicholasjma
body:
- type: markdown
attributes:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
#----------------------------------------------
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
# TODO(amir): enable `windows-latest`, `macos-latest` and fix possible `poetry` issues and glmnet
os: ["ubuntu-latest"]
Expand Down Expand Up @@ -58,12 +58,17 @@ jobs:
# therefore, all the CI jobs for those python versions failed at first, then we re-run the
# jobs, the cached venv using `python v3.8` will be retrieved and the jobs will run successfully
# ideally, we should be able to add `python-versions` here to distinguish between caches
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
# key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# ----- install dependencies -----
#----------------------------------------------
- name: Install Dependencies
run: poetry install -vv
# NOTE: `glmnet` has not been updated since 2020; trying to build it on-the-fly
# https:/civisanalytics/python-glmnet/issues/79
run: |
poetry run python -m pip install glmnet --no-use-pep517
poetry install -vv
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
#----------------------------------------------
# ----- Integration test suite -----
Expand Down
12 changes: 11 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Any, Dict, List, Optional, Tuple, Union

import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
from assertpy import assert_that
Expand Down Expand Up @@ -403,6 +404,15 @@ def _validate_figure_type_and_size(
-------
None
"""
# TODO(amir): currently, the `PIL.Image()` is used to load the saved figures and this would end up
# different results per operating systems. Therefore, for now defining a `tolerance` range ~ 5%
# to get away with the errors. Ideally, we should be able to match the `exact` size
_IMAGE_SIZE_ERROR_TOLERANCE_ERROR = 0.05
with Image.open(path) as img:
assert_that(img).is_instance_of(expected_type)
assert_that(img.size).is_equal_to(expected_size)
assert_that(img.size).is_instance_of(tuple)
npt.assert_allclose(
actual=img.size,
desired=expected_size,
rtol=_IMAGE_SIZE_ERROR_TOLERANCE_ERROR,
)

0 comments on commit f14321e

Please sign in to comment.