Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update importlib-metadata requirement from ~=4.0 to >=4,<7 #14

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
venv
ir_axioms.egg-info
dist
data
build
.pytest_cache
.idea
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
os:
- ubuntu-latest
python:
- "3.7"
- "3.8"
- "3.9"
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -67,7 +66,6 @@ jobs:
os:
- ubuntu-latest
python:
- "3.7"
- "3.8"
- "3.9"
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -96,7 +94,6 @@ jobs:
os:
- ubuntu-latest
python:
- "3.7"
- "3.8"
- "3.9"
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -125,7 +122,6 @@ jobs:
os:
- ubuntu-latest
python:
- "3.7"
- "3.8"
- "3.9"
backend:
Expand Down Expand Up @@ -163,7 +159,6 @@ jobs:
os:
- ubuntu-latest
python:
- "3.7"
- "3.8"
- "3.9"
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -198,7 +193,6 @@ jobs:
os:
- ubuntu-latest
python:
- "3.7"
- "3.8"
- "3.9"
backend:
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ RUN \

ENV TERRIER_VERSION="5.7"
ENV TERRIER_HELPER_VERSION="0.0.7"
RUN /venv/bin/python -c "from pyterrier import init; init(version='${TERRIER_VERSION}', helper_version='${TERRIER_HELPER_VERSION}')" \
&& /venv/bin/python -m ir_axioms preferences --run-file data/tira/input-of-re-ranker/run.jsonl --run-format jsonl --index-dir data/tira/output-of-indexer/index --output-dir data/tira/output AND ANTI-REG ASPECT-REG DIV LB1 LNC1 LEN-AND LEN-DIV LEN-M-AND LEN-M-TDC LNC1 M-AND M-TDC PROX1 PROX2 PROX3 PROX4 PROX5 REG STMC1 STMC2 TF-LNC TFC1 TFC3
RUN /venv/bin/python -c "from pyterrier import init; init(version='${TERRIER_VERSION}', helper_version='${TERRIER_HELPER_VERSION}')"

ADD . .

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ tira-run \
--input-run ${PWD}/data/tira/output-of-indexer \
--output-directory ${PWD}/data/tira/output \
--image webis/ir_axioms:0.2.13 \
--command '/venv/bin/python -m ir_axioms --offline preferences --run-file $inputDataset/run.jsonl --run-format jsonl --index-dir $inputRun/index --output-dir $outputDir AND ANTI-REG ASPECT-REG DIV LB1 LNC1 LEN-AND LEN-DIV LEN-M-AND LEN-M-TDC LNC1 M-AND M-TDC PROX1 PROX2 PROX3 PROX4 PROX5 REG STMC1 STMC2 TF-LNC TFC1 TFC3'
--command '/venv/bin/python -m ir_axioms --offline --terrier-version 5.7 --terrier-helper-version 0.0.7 preferences --run-file $inputDataset/run.jsonl --run-format jsonl --index-dir $inputRun/index --output-dir $outputDir AND ANTI-REG ASPECT-REG DIV LB1 LNC1 LEN-AND LEN-DIV LEN-M-AND LEN-M-TDC LNC1 M-AND M-TDC PROX1 PROX2 PROX3 PROX4 PROX5 REG STMC1 STMC2 TF-LNC TFC1 TFC3'
```

## Citation
Expand Down
9 changes: 2 additions & 7 deletions ir_axioms/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def preferences(cli_options: CliOptions, run_path: Path,
del run[col]
else:
raise ValueError(f"Unknown run format: {run_format}")
original_columns = set(run.columns)

echo(f"Load axioms: {', '.join(axiom_names)}")
axioms: Dict[str, Axiom] = {name: to_axiom(name) for name in axiom_names}
Expand All @@ -118,13 +117,9 @@ def preferences(cli_options: CliOptions, run_path: Path,
all_preferences = pipeline.transform(run)

output_path.mkdir(exist_ok=True)
output_path = output_path / ('preferences.jsonl' + ('.gz' if output_compress == 'gzip' else ''))
output_path = output_path / (
'preferences.jsonl' + ('.gz' if output_compress == 'gzip' else ''))
echo(f"Save axiomatic preferences to: {output_path}")
shared_columns = set(all_preferences.columns) & original_columns
non_shared_columns = original_columns - shared_columns
select_columns = (shared_columns |
{f"{col}_a" for col in non_shared_columns} |
{f"{col}_b" for col in non_shared_columns})

if output_minimal:
for i in ['query', 'text_a', 'score_a', 'text_b', 'score_b']:
Expand Down
2 changes: 1 addition & 1 deletion ir_axioms/utils/nltk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from nltk.downloader import Downloader

_downloader = Downloader()
offline=False
offline = False


def download_nltk_dependencies(*dependencies: str) -> None:
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ authors = [
]
description = "Intuitive interface to many IR axioms."
readme = "README.md"
requires-python = ">=3.7,<3.10"
requires-python = ">=3.8,<3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
Expand All @@ -30,7 +29,7 @@ dependencies = [
"diskcache~=5.4",
"fasteners~=0.17.3",
"h5py~=3.6",
"importlib-metadata~=4.0",
"importlib-metadata>=4,<7",
"ir-datasets~=0.4",
"joblib~=1.0",
"lz4~=4.0",
Expand Down