Skip to content

Commit

Permalink
Merge pull request #153 from sb-ai-lab/fix/test_data
Browse files Browse the repository at this point in the history
added test data
added ruff
fixed code for ruff
  • Loading branch information
tikhomirovd authored Mar 6, 2025
2 parents ad46a0c + fd3b2fe commit 29bd4d5
Show file tree
Hide file tree
Showing 76 changed files with 1,768 additions and 1,692 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Continuous Integration

on:
push:
branches: [ master]
branches: [ master ]
paths-ignore:
- "docs/**"
- "*.md"
pull_request:
branches: [ master]
branches: [ master ]
paths-ignore:
- "docs/**"
- "*.md"
Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
Expand All @@ -28,11 +28,33 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies for tox
run: |
python -m pip install --upgrade pip
pip install tox
pip install poetry
pip install pytest
poetry install --no-root --without dev
- name: Run unit tests
run: tox -e py

linters:
runs-on: ubuntu-latest # Линтеры и доки только на одной версии
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies for linters
run: |
python -m pip install --upgrade pip
pip install tox
pip install poetry
poetry install --no-root
- name: Run tox tests
run: tox
- name: Run linters (mypy, codespell, docs)
run: |
tox
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# -- Path setup --------------------------------------------------------------

import datetime

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand All @@ -19,7 +20,7 @@
sys.path.insert(0, LIB_PATH)

project = "HypEx"
copyright = "%s, AI Lab ML Tools" % str(datetime.datetime.now().year)
copyright = f"{datetime.datetime.now().year}, AI Lab ML Tools"
author = "AI Lab ML Tools"

os.environ["DOCUMENTATION_ENV"] = "True"
Expand Down
4 changes: 1 addition & 3 deletions docs/mock_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ def __init__(self, attr1: str, attr2: str):
self.attr2 = attr2
date = datetime.datetime.now()
print(
"{}.{}.{} {}:{}:{}".format(
date.day, date.month, date.year, date.hour, date.minute, date.second
)
f"{date.day}.{date.month}.{date.year} {date.hour}:{date.minute}:{date.second}"
)


Expand Down
10 changes: 8 additions & 2 deletions examples/tutorials/AATestTutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@
},
"outputs": [],
"source": [
"from hypex.dataset import Dataset, InfoRole, TreatmentRole, TargetRole, StratificationRole\n",
"from hypex import AATest"
"from hypex import AATest\n",
"from hypex.dataset import (\n",
" Dataset,\n",
" InfoRole,\n",
" StratificationRole,\n",
" TargetRole,\n",
" TreatmentRole,\n",
")"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions examples/tutorials/ABTestTutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"source": [
"import random\n",
"\n",
"from hypex.dataset import Dataset, InfoRole, TreatmentRole, TargetRole\n",
"from hypex import ABTest"
"from hypex import ABTest\n",
"from hypex.dataset import Dataset, InfoRole, TargetRole, TreatmentRole"
]
},
{
Expand Down Expand Up @@ -531,7 +531,7 @@
"metadata": {},
"source": [
"## AB test\n",
"Then we select one of the pre-assembled pipelines, in our case `ABTest`. Also, a custom pipline can be created based on your specific needs and requirements with custom executors.\n",
"Then we select one of the pre-assembled pipelines, in our case `ABTest`. Also, a custom pipeline can be created based on your specific needs and requirements with custom executors.\n",
"After that we wrap our prepared `dataset` into `ExperimentData` to be able to run experiments on it and then execute the test with this data passed as the argument."
]
},
Expand Down Expand Up @@ -868,7 +868,7 @@
"source": [
"## Additional tests in AB Test \n",
"\n",
"It is possible to add u-test and chi2-test in pipline. "
"It is possible to add u-test and chi2-test in pipeline."
]
},
{
Expand Down
Loading

0 comments on commit 29bd4d5

Please sign in to comment.