-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into why-predicates-lesson
- Loading branch information
Showing
1,049 changed files
with
957,093 additions
and
16,314 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,6 @@ | ||
# Why is this file here in OAK? -> https://github.com/linkml/schema-automator/pull/104#issuecomment-1307388416 | ||
# This file may be removed after funowl is fixed to work with platform-specific line endings. | ||
|
||
# https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings | ||
# Declare files that will always have LF line endings on checkout. | ||
*.ofn text eol=lf |
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 |
---|---|---|
|
@@ -17,9 +17,9 @@ jobs: | |
matrix: | ||
python-version: [ '3.9', '3.10' ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
|
@@ -29,10 +29,16 @@ jobs: | |
run: tox -e flake8 | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ '3.9', '3.10' ] | ||
os: [ ubuntu-latest, windows-latest ] | ||
python-version: [ "3.9", "3.10" ] | ||
exclude: | ||
- os: windows-latest | ||
python-version: "3.9" | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
|
@@ -43,21 +49,24 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
#---------------------------------------------- | ||
# install & configure poetry | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
run: | | ||
pip install --upgrade pip | ||
pip install poetry | ||
# uses: snok/[email protected] | ||
# with: | ||
# virtualenvs-create: true | ||
# virtualenvs-in-project: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
# - name: Load cached venv | ||
# id: cached-poetry-dependencies | ||
|
@@ -67,17 +76,24 @@ jobs: | |
# key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
run: | | ||
poetry add setuptools@latest | ||
poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction --extras gilda | ||
run: poetry install --no-interaction --extras "gilda" | ||
|
||
- name: Get Gilda resources | ||
run: | | ||
poetry run python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')" | ||
poetry run python -m adeft.download | ||
#---------------------------------------------- | ||
# run test suite + coverage report | ||
|
@@ -89,16 +105,17 @@ jobs: | |
poetry run coverage combine | ||
poetry run coverage xml | ||
poetry run coverage report -m | ||
shell: bash | ||
env: | ||
BIOPORTAL_API_KEY: ${{ secrets.BIOPORTAL_API_KEY }} | ||
|
||
#---------------------------------------------- | ||
# upload coverage results | ||
#---------------------------------------------- | ||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v1.0.5 | ||
uses: codecov/codecov-action@v3.1.1 | ||
with: | ||
name: codecov-results-${{ matrix.python-version }} | ||
name: codecov-results-${{ matrix.os }}-${{ matrix.python-version }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
fail_ci_if_error: true | ||
fail_ci_if_error: false |
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,24 +1,32 @@ | ||
.idea | ||
.vscode | ||
__pycache__ | ||
.idea/ | ||
.tox/ | ||
__pycache__/ | ||
.ipynb_checkpoints/ | ||
docs/_build/ | ||
docs/src/ | ||
docs/datamodels/*/*.md | ||
tests/output/ | ||
|
||
dist/ | ||
db/ | ||
|
||
.DS_Store | ||
.template.db | ||
.vscode | ||
.venv | ||
|
||
docs/_build/ | ||
docs/src/ | ||
docs/datamodels/*/*.md | ||
|
||
notebooks/output/*json | ||
notebooks/output/*tsv | ||
notebooks/input/* | ||
|
||
|
||
notebooks/*/output/*json | ||
notebooks/*/output/*tsv | ||
notebooks/api-key.txt | ||
|
||
.template.db | ||
.venv | ||
.tox/ | ||
.coverage.* | ||
.coverage | ||
coverage.* | ||
tests/input/fhirjson_conf.json | ||
|
||
oak_hp.profile | ||
oak_semsimian_hp.profile | ||
notebooks/demo.tsv |
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 |
---|---|---|
|
@@ -3,23 +3,32 @@ RUN = poetry run | |
test: | ||
$(RUN) python -m unittest tests/test_*py tests/*/test_*py | ||
|
||
# not yet deployed | ||
doctest: | ||
find src docs -type f \( -name "*.rst" -o -name "*.md" -o -name "*.py" \) -print0 | xargs -0 $(RUN) python -m doctest --option ELLIPSIS --option NORMALIZE_WHITESPACE | ||
|
||
%-doctest: % | ||
$(RUN) python -m doctest --option ELLIPSIS --option NORMALIZE_WHITESPACE $< | ||
|
||
## Compiled | ||
|
||
MODELS = ontology_metadata obograph validation_datamodel summary_statistics_datamodel lexical_index mapping_rules_datamodel text_annotator oxo taxon_constraints similarity search_datamodel cross_ontology_diff association | ||
MODELS = ontology_metadata obograph validation_datamodel summary_statistics_datamodel lexical_index mapping_rules_datamodel text_annotator oxo taxon_constraints similarity search_datamodel cross_ontology_diff association class_enrichment value_set_configuration fhir mapping_cluster_datamodel cx item_list input_specification | ||
|
||
pyclasses: $(patsubst %, src/oaklib/datamodels/%.py, $(MODELS)) | ||
jsonschema: $(patsubst %, src/oaklib/datamodels/%.schema.json, $(MODELS)) | ||
owl: $(patsubst %, src/oaklib/datamodels/%.owl.ttl, $(MODELS)) | ||
|
||
src/oaklib/datamodels/%.py: src/oaklib/datamodels/%.yaml | ||
# $(RUN) gen-pydantic $< > [email protected] && mv [email protected] $@ | ||
$(RUN) gen-python $< > [email protected] && mv [email protected] $@ | ||
$(RUN) tox -e lint | ||
src/oaklib/datamodels/%.schema.json: src/oaklib/datamodels/%.yaml | ||
$(RUN) gen-json-schema $< > $@.tmp && mv $@.tmp $@ | ||
src/oaklib/datamodels/%.owl.ttl: src/oaklib/datamodels/%.yaml | ||
$(RUN) gen-owl --no-metaclasses --no-type-objects $< > $@.tmp && mv $@.tmp $@ | ||
|
||
RUN_GENDOC = $(RUN) gen-doc --dialect myst | ||
gendoc: gendoc-om gendoc-og gendoc-ss gendoc-val gendoc-mr gendoc-li gendoc-ann gendoc-search gendoc-xodiff gendoc-sim gendoc-assoc | ||
gendoc: gendoc-om gendoc-og gendoc-ss gendoc-val gendoc-mr gendoc-li gendoc-ann gendoc-search gendoc-xodiff gendoc-sim gendoc-assoc gendoc-tc gendoc-itemlist gendoc-ce | ||
|
||
gendoc-om: src/oaklib/datamodels/ontology_metadata.yaml | ||
$(RUN_GENDOC) $< -d docs/datamodels/ontology-metadata/ | ||
|
@@ -43,6 +52,12 @@ gendoc-xodiff: src/oaklib/datamodels/cross_ontology_diff.yaml | |
$(RUN_GENDOC) $< -d docs/datamodels/cross-ontology-diff | ||
gendoc-assoc: src/oaklib/datamodels/association.yaml | ||
$(RUN_GENDOC) $< -d docs/datamodels/association | ||
gendoc-tc: src/oaklib/datamodels/taxon_constraints.yaml | ||
$(RUN_GENDOC) $< -d docs/datamodels/taxon-constraints | ||
gendoc-itemlist: src/oaklib/datamodels/item_list.yaml | ||
$(RUN_GENDOC) $< -d docs/datamodels/item-list | ||
gendoc-ce: src/oaklib/datamodels/class_enrichment.yaml | ||
$(RUN_GENDOC) $< -d docs/datamodels/class-enrichment | ||
|
||
nb: | ||
$(RUN) jupyter notebook | ||
|
@@ -70,3 +85,34 @@ tests/input/%.db: tests/input/%.owl | |
# this can be used outside the poetry environment | ||
bin/runoak: | ||
echo `poetry run which runoak` '"$$@"' > $@ && chmod +x $@ | ||
|
||
# Benchmarking for Semsimian | ||
RUNOAK := $(shell which runoak) | ||
SEMSIMIAN_HP_PROFILE = "oak_semsimian_hp.profile" | ||
NON_SEMSIMIAN_HP_PROFILE = "oak_hp.profile" | ||
SEMSIMIAN_PHENIO_PROFILE = "oak_semsimian_phenio.profile" | ||
NON_SEMSIMIAN_PHENIO_PROFILE = "oak_phenio.profile" | ||
HP_TERMS = "HPO_terms.txt" | ||
MP_TERMS = "MP_terms.txt" | ||
PROFILER_SCRIPT= "src/oaklib/implementations/semsimian/profiler.py" | ||
|
||
run_benchmark: benchmarks profiles | ||
|
||
benchmarks: | ||
time python -m cProfile -o $(SEMSIMIAN_HP_PROFILE) -s tottime $(RUNOAK) -i semsimian:sqlite:obo:hp similarity -p i,p HP:0002205 @ HP:0000166 HP:0012461 HP:0002167 HP:0012390 HP:0002840 HP:0002840 HP:0012432 > /dev/null | ||
time python -m cProfile -o $(NON_SEMSIMIAN_HP_PROFILE) -s tottime $(RUNOAK) -i sqlite:obo:hp similarity -p i,p HP:0002205 @ HP:0000166 HP:0012461 HP:0002167 HP:0012390 HP:0002840 HP:0002840 HP:0012432 > /dev/null | ||
|
||
profiles: | ||
python $(PROFILER_SCRIPT) $(SEMSIMIAN_HP_PROFILE) | ||
python $(PROFILER_SCRIPT) $(NON_SEMSIMIAN_HP_PROFILE) | ||
|
||
phenio-benchmarks: | ||
$(RUNOAK) -i sqlite:obo:hp descendants -p i HP:0000118 > $(HP_TERMS) | ||
$(RUNOAK) -i sqlite:obo:mp descendants -p i MP:0000001 > $(MP_TERMS) | ||
time python -m cProfile -o $(SEMSIMIAN_PHENIO_PROFILE) -s tottime $(RUNOAK) -i semsimian:sqlite:obo:phenio similarity -p i --set1-file $(HP_TERMS) --set2-file $(MP_TERMS) -O csv -o HP_vs_MP_semsimian.tsv | ||
time python -m cProfile -o $(NON_SEMSIMIAN_PHENIO_PROFILE) -s tottime $(RUNOAK) -i sqlite:obo:phenio similarity -p i --set1-file $(HP_TERMS) --set2-file $(MP_TERMS) -O csv -o HP_vs_MP_semsimian.tsv | ||
|
||
phenio-profiles: | ||
python $(PROFILER_SCRIPT) $(SEMSIMIAN_PHENIO_PROFILE) | ||
python $(PROFILER_SCRIPT) $(NON_SEMSIMIAN_PHENIO_PROFILE) | ||
|
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
Oops, something went wrong.