-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e86d5c
commit 9ed02ae
Showing
32 changed files
with
904 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Lint | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
run-linters: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install deps | ||
run: python3 -m pip install poetry==1.8.2 && make init | ||
|
||
- name: Run all linters and formatters | ||
run: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
fail_fast: true | ||
default_language_version: | ||
python: python3.12 | ||
|
||
ci: | ||
autoupdate_commit_msg: "chore: update pre-commit hooks" | ||
autofix_commit_msg: "style: pre-commit fixes" | ||
skip: [make-format, make-lint] | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: local | ||
hooks: | ||
- id: make-format | ||
name: make-format | ||
entry: make format | ||
language: system | ||
|
||
- id: make-lint | ||
name: make-lint | ||
entry: make lint | ||
language: system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.PHONY: init lint format stubs | ||
|
||
## Install dependencies | ||
init: | ||
poetry install | ||
poetry run pre-commit install | ||
|
||
## Run all formatters and linters in project | ||
lint: | ||
poetry run ruff check desbordante-stubs \ | ||
& poetry run ruff format --check desbordante-stubs \ | ||
& poetry run black --check desbordante-stubs | ||
|
||
## Reformat code | ||
format: | ||
poetry run ruff format desbordante-stubs & poetry run ruff check --fix & poetry run black desbordante-stubs | ||
|
||
## Generate stubs | ||
stubs: | ||
pybind11-stubgen desbordante | ||
@if [ -d "desbordante-stubs" ]; then rm -rf desbordante-stubs; fi | ||
@if [ -d "stubs/desbordante" ]; then mv stubs/desbordante desbordante-stubs; fi | ||
rm -rf stubs | ||
make format | ||
|
||
|
||
.DEFAULT_GOAL := help | ||
# See <https://gist.github.com/klmr/575726c7e05d8780505a> for explanation. | ||
help: | ||
@echo "$$(tput setaf 2)Available rules:$$(tput sgr0)";sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## /---/;td" -e"s/:.*//;G;s/\\n## /===/;s/\\n//g;p;}" ${MAKEFILE_LIST}|awk -F === -v n=$$(tput cols) -v i=4 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"- %s%s%s\n",a,$$1,z;m=split($$2,w,"---");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;}printf"%*s%s\n",-i," ",w[j];}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from __future__ import annotations | ||
from . import algorithms | ||
|
||
__all__ = ["algorithms"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from __future__ import annotations | ||
from desbordante.ind.algorithms import Mind | ||
from desbordante.ind.algorithms import Spider | ||
from desbordante.ind.algorithms import Spider as Default | ||
|
||
__all__ = ["Default", "Mind", "Spider"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from __future__ import annotations | ||
import desbordante | ||
from . import algorithms | ||
|
||
__all__ = ["CFD", "CfdAlgorithm", "Item", "algorithms"] | ||
|
||
class CFD: | ||
def __str__(self) -> str: ... | ||
@property | ||
def lhs_items(self) -> list[Item]: ... | ||
@property | ||
def rhs_item(self) -> Item: ... | ||
|
||
class CfdAlgorithm(desbordante.Algorithm): | ||
def get_cfds(self) -> list[CFD]: ... | ||
|
||
class Item: | ||
@property | ||
def attribute(self) -> int: ... | ||
@property | ||
def value(self) -> str | None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from __future__ import annotations | ||
import desbordante.cfd | ||
|
||
__all__ = ["Default", "FDFirst"] | ||
|
||
class FDFirst(desbordante.cfd.CfdAlgorithm): | ||
""" | ||
Options: | ||
table: table processed by the algorithm | ||
columns_number: Number of columns in the part of the dataset if you want to use algo not on the full dataset, but on its part | ||
cfd_minsup: minimum support value (integer number between 1 and number of tuples in dataset) | ||
cfd_minconf: cfd minimum confidence value (between 0 and 1) | ||
tuples_number: Number of tuples in the part of the dataset if you want to use algo not on the full dataset, but on its part | ||
cfd_max_lhs: cfd max considered LHS size | ||
cfd_substrategy: CFD lattice traversal strategy to use | ||
[dfs|bfs] | ||
""" | ||
|
||
def __init__(self) -> None: ... | ||
|
||
Default = FDFirst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
""" | ||
Contains the types of data supported by Desbordante. | ||
Contains the types of data supported by Desbordante. | ||
Currently only used as tags for Algorithm.get_option_type | ||
Currently only used as tags for Algorithm.get_option_type | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
__all__ = ["Table"] | ||
__all__ = ["ColumnCombination", "Table"] | ||
|
||
class ColumnCombination: | ||
def __str__(self) -> str: ... | ||
@property | ||
def column_indices(self) -> list[int]: ... | ||
@property | ||
def table_index(self) -> int: ... | ||
|
||
class Table: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from __future__ import annotations | ||
from . import algorithms | ||
|
||
__all__ = ["DD", "algorithms"] | ||
|
||
class DD: | ||
def __repr__(self) -> str: ... | ||
def __str__(self) -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from __future__ import annotations | ||
import desbordante | ||
import desbordante.dd | ||
|
||
__all__ = ["Default", "Split"] | ||
|
||
class Split(desbordante.Algorithm): | ||
""" | ||
Options: | ||
table: table processed by the algorithm | ||
difference_table: CSV table containing difference limits for each column | ||
num_rows: Use only first N rows of the table | ||
num_columns: Use only first N columns of the table | ||
""" | ||
|
||
def __init__(self) -> None: ... | ||
def get_dds(self) -> list[desbordante.dd.DD]: ... | ||
|
||
Default = Split |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from __future__ import annotations | ||
from . import algorithms | ||
|
||
__all__ = ["algorithms"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from __future__ import annotations | ||
import desbordante | ||
import desbordante.fd_verification | ||
|
||
__all__ = ["Default", "DynamicFDVerifier"] | ||
|
||
class DynamicFDVerifier(desbordante.Algorithm): | ||
""" | ||
Options: | ||
table: table processed by the algorithm | ||
insert: Rows to be inserted into the table using the insert operation | ||
delete: Rows to be deleted from the table using the delete operation | ||
update: Rows to be replaced in the table using the update operation | ||
lhs_indices: LHS column indices | ||
rhs_indices: RHS column indices | ||
""" | ||
|
||
def __init__(self) -> None: ... | ||
def fd_holds(self) -> bool: ... | ||
def get_error(self) -> float: ... | ||
def get_highlights(self) -> list[desbordante.fd_verification.Highlight]: ... | ||
def get_num_error_clusters(self) -> int: ... | ||
|
||
Default = DynamicFDVerifier |
Oops, something went wrong.