Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #38 from credo-ai/release/0.1.2
Browse files Browse the repository at this point in the history
Release/0.1.2
  • Loading branch information
nate-credoai authored May 2, 2023
2 parents 2cf23fb + 9183cbb commit 6630944
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 27 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ on:
jobs:
run-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -28,14 +32,16 @@ jobs:
pip install -r requirements-dev.txt
- name: Run tests
run: |
scripts/test.sh
set -o pipefail
scripts/test.sh | tee ./pytest-coverage.txt
- name: my-artifact
if: always()
if: always() && !env.ACT
uses: actions/upload-artifact@v3
with:
name: pytest-coverage
path: pytest-coverage.txt
- name: Pytest coverage comment
if: always() && !env.ACT
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
2 changes: 1 addition & 1 deletion connect/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = "0.1.1"
__version__ = "0.1.2"
2 changes: 1 addition & 1 deletion connect/evidence/evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def __init__(
def data(self):
columns = [
{"value": k, "type": self._transform_type(v)}
for k, v in self._data.dtypes.iteritems()
for k, v in self._data.dtypes.items()
]
return {
"columns": columns,
Expand Down
8 changes: 4 additions & 4 deletions connect/evidence/lens_evidence/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from connect.utils import Scrubber, ValidationError

from .evidence import DataProfilerEvidence, ModelProfilerEvidence
from .utils import get_pandas_profile_type
from .utils import get_ydata_profile_type

PandasProfileType = get_pandas_profile_type()
ydataProfileType = get_ydata_profile_type()


class DataProfilerContainer(EvidenceContainer):
Expand All @@ -30,9 +30,9 @@ def _validate(self, data):
pass

def _validate_inputs(self, data):
if not isinstance(data, PandasProfileType):
if not isinstance(data, ydataProfileType):
raise ValidationError(
"'data' must be a pandas_profiling.profile_report.ProfileReport"
"'data' must be a ydata_profiling.profile_report.ProfileReport"
)


Expand Down
16 changes: 8 additions & 8 deletions connect/evidence/lens_evidence/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
from typing import TYPE_CHECKING, TypeVar


def get_pandas_profile_type():
"""check if deepchecks is imported. If not, define object for type checking"""
def get_ydata_profile_type():
"""check if ydata profiling is imported. If not, define object for type checking"""
if TYPE_CHECKING:
try:
from pandas_profiling import ProfileReport
from ydata_profiling import ProfileReport

pandas_profile_type = ProfileReport
ydata_profiling = ProfileReport
except ImportError:
pandas_profile_type = TypeVar("Profilereport")
ydata_profiling = TypeVar("ProfileReport")
else:
from pandas_profiling import ProfileReport
from ydata_profiling import ProfileReport

pandas_profile_type = ProfileReport
return pandas_profile_type
ydata_profiling = ProfileReport
return ydata_profiling
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
json-api-doc>=0.15.0
python-dotenv>=0.19.2
numpy >= 1.22.0
pandas >= 1.4.1
numpy >= 1.21.6
pandas >= 1.3.5

7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
LICENSE = ""
DOWNLOAD_URL = "https://github.com/credo-ai/credoai_connect"
VERSION = __version__
PYTHON_REQUIRES = ">=3.8"
PYTHON_REQUIRES = ">=3.7"

# Fetch ReadMe
with open("README.md", "r") as fh:
Expand All @@ -36,9 +36,11 @@

CLASSIFIERS = [
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Operating System :: OS Independent",
]
Expand All @@ -47,7 +49,6 @@


if __name__ == "__main__":

import sys

from setuptools import setup
Expand Down
2 changes: 0 additions & 2 deletions tests/governance/test_governance.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def test_register_with_use_case_name_and_policy_pack_key_not_exist(self, gov, ap
assert False == gov.registered

def test_register_with_assessment_plan(self, gov):

gov.register(assessment_plan=ASSESSMENT_PLAN_JSON_STR)

assert USE_CASE_ID == gov._use_case_id
Expand All @@ -148,7 +147,6 @@ def test_register_with_assessment_plan(self, gov):
assert {"metric_type": "accuracy_score"} == req.label

def test_register_with_assessment_plan_file(self, gov, plan_file_mock):

gov.register(assessment_plan_file="filename")

assert USE_CASE_ID == gov._use_case_id
Expand Down

0 comments on commit 6630944

Please sign in to comment.