Skip to content

Commit

Permalink
Fix: #23. Use a separate virtuoso instance. Add tests. Add skills.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioggstream committed May 7, 2024
1 parent 5ca9974 commit 9d2598c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
Binary file modified esco/esco.json.gz
Binary file not shown.
Binary file modified esco/esco_o.json.gz
Binary file not shown.
Binary file modified esco/esco_s.json.gz
Binary file not shown.
9 changes: 6 additions & 3 deletions tests/test_localdb_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def test_get_skill(db):
assert skill["skillType"] == "skill"


def test_search_skill_label(db):
products = {"ansible", "JBoss", "Bash"}
@pytest.mark.parametrize(
"products,expected_results",
[({"ansible", "JBoss", "Bash"}, 3), ({"agile", "scrum", "kanban"}, 1)],
)
def test_search_skill_label(db, products, expected_results):
skills = db.search_products(products)
assert len(skills) >= 3
assert len(skills) >= expected_results
11 changes: 10 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ commands =
python -m pytest tests/ {posargs}


#
# Install in the tox environment all dependencies
# and run the model generation.
# Note that this won't run tests.
#
[testenv:model]
deps =
.
Expand All @@ -42,12 +47,16 @@ allowlist_externals =
sitepackages = True

commands_pre =
python -m spacy download en_core_web_trf
# Eventually download en_core_web_trf.
python -c "import spacy; m='en_core_web_trf'; spacy.util.is_package(m) or spacy.cli.download(m)"
# Ensure sparql is populated.
pytest tests/test_sparql.py

commands =
python model/model.py
rm generated/output -fr
mkdir -p generated/output
pytest tests/test_localdb_base.py
python -m spacy package ./generated/en_core_web_trf_esco_ner ./generated/output --build wheel

bash -c '[ "{posargs}" == "upload" ] && python -m spacy huggingface-hub push generated/output/en_core_web_trf_esco_ner*/dist/*.whl'
Expand Down

0 comments on commit 9d2598c

Please sign in to comment.