Skip to content

Commit

Permalink
Merge branch 'main' into fix_statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
wilko77 authored Jul 7, 2023
2 parents 61537f3 + 083ec4c commit 79ea87a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/typechecking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: mypy (pinned)
run: |
pip install --upgrade pip
pip install -U mypy==0.931
pip install -U mypy==1.3.0
pip install -U pydantic
pip install -U types-setuptools
mypy blocklib --ignore-missing-imports --no-implicit-optional --disallow-untyped-calls
Expand Down
4 changes: 2 additions & 2 deletions blocklib/pprlpsig.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ def filter_reversed_index(self, data: Sequence[Sequence], reversed_index: Dict):
if filter_type == "ratio":
min_occur_ratio = self.filter_config.min
max_occur_ratio = self.filter_config.max
reversed_index = {k: v for k, v in reversed_index.items() if n * max_occur_ratio > len(v) > n * min_occur_ratio}
reversed_index = {k: v for k, v in reversed_index.items() if n * max_occur_ratio >= len(v) >= n * min_occur_ratio}
elif filter_type == "count":
min_occur_count = self.filter_config.min
max_occur_count = self.filter_config.max
reversed_index = {k: v for k, v in reversed_index.items() if max_occur_count > len(v) > min_occur_count}
reversed_index = {k: v for k, v in reversed_index.items() if max_occur_count >= len(v) >= min_occur_count}
else:
raise NotImplementedError("Don't support {} filter yet.".format(filter_type))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_candidate_block_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_generate_candidate_blocks_psig(self):
"record-id-col": 0,
"filter": {
"type": "ratio",
"max": 0.5,
"max": 0.49,
"min": 0.0,
},
"blocking-filter": {
Expand Down
6 changes: 3 additions & 3 deletions tests/test_pprlpsig.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_build_reversed_index(self):
"record-id-col": 0,
"filter": {
"type": "ratio",
"max": 0.5,
"max": 0.49,
"min": 0.2,
},
"blocking-filter": {
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_build_reversed_index_feature_name(self):
"record-id-col": 0,
"filter": {
"type": "ratio",
"max": 0.5,
"max": 0.49,
"min": 0.2,
},
"blocking-filter": {
Expand Down Expand Up @@ -133,7 +133,7 @@ def test_build_reversed_index_feature_name(self):
"record-id-col": 0,
"filter": {
"type": "ratio",
"max": 0.5,
"max": 0.49,
"min": 0.2,
},
"blocking-filter": {
Expand Down

0 comments on commit 79ea87a

Please sign in to comment.