diff --git a/.github/workflows/check-dependencies.yaml b/.github/workflows/check-dependencies.yaml new file mode 100644 index 0000000..e6babd5 --- /dev/null +++ b/.github/workflows/check-dependencies.yaml @@ -0,0 +1,44 @@ +--- +name: Check Dependencies in Pyproject.toml + +# Controls when the action will run. +on: + pull_request: + types: [opened, synchronize, reopened] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + types: trigger-run-check-dependencies + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + python: [ "3.9", "3.10" ] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: setup python environment + with: + python-version: ${{ matrix.python }} + + # this step we remove and rebuild the poetry.lock file to ensure that the tests that follow can be run + # with the latest dependencies + - name: Install dependencies + run: | + pip install --upgrade pip + pip install poetry + rm -rf poetry.lock + poetry install + + - name: Run tests + run: | + make test \ No newline at end of file diff --git a/.github/workflows/initialize-toolkit-daily.yaml b/.github/workflows/initialize-toolkit-daily.yaml new file mode 100644 index 0000000..9f27b57 --- /dev/null +++ b/.github/workflows/initialize-toolkit-daily.yaml @@ -0,0 +1,42 @@ +--- +name: Check BMT initialization daily + +on: + pull_request: + schedule: + - cron: '0 5 * * *' # once per day at midnight ET + workflow_dispatch: + # Allows you to run this workflow manually from the Actions tab + types: trigger-run-check-toolkit-initialization + +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + python: [ "3.9", "3.10" ] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: setup python environment + with: + python-version: ${{ matrix.python }} + + # this step we remove and rebuild the poetry.lock file to ensure that the tests that follow can be run + # with the latest dependencies + - name: Install dependencies + run: | + pip install --upgrade pip + pip install poetry + rm -rf poetry.lock + poetry install + + - name: Run tests + run: | + make test \ No newline at end of file diff --git a/bmt/toolkit.py b/bmt/toolkit.py index ed920c6..8031aef 100644 --- a/bmt/toolkit.py +++ b/bmt/toolkit.py @@ -19,7 +19,7 @@ Url = str Path = str -LATEST_BIOLINK_RELEASE = "3.5.4" +LATEST_BIOLINK_RELEASE = "3.6.0" REMOTE_PATH = f"https://raw.githubusercontent.com/biolink/biolink-model/v{LATEST_BIOLINK_RELEASE}/biolink-model.yaml" PREDICATE_MAP = f"https://raw.githubusercontent.com/biolink/biolink-model/v{LATEST_BIOLINK_RELEASE}/predicate_mapping.yaml" diff --git a/tests/unit/test_toolkit.py b/tests/unit/test_toolkit.py index fe75233..a7cabc9 100644 --- a/tests/unit/test_toolkit.py +++ b/tests/unit/test_toolkit.py @@ -86,6 +86,12 @@ def test_get_model_version(toolkit): assert version == LATEST_BIOLINK_RELEASE +def test_sv(toolkit): + v = toolkit.view + ancs = v.slot_ancestors('broad match') + print(ancs) + assert 'related to' in ancs + def test_get_denormalized_association_slots(toolkit): annotations = toolkit.get_denormalized_association_slots(formatted=True) print(annotations) @@ -896,11 +902,11 @@ def test_descendants(toolkit): def test_children(toolkit): assert CAUSES in toolkit.get_children("contributes to") assert "physically interacts with" in toolkit.get_children(INTERACTS_WITH) - assert "transcript" in toolkit.get_children(NUCLEIC_ACID_ENTITY) + assert "transcript" in toolkit.get_children(BIOLOGICAL_ENTITY) assert GENE in toolkit.get_children(GENE_OR_GENE_PRODUCT) assert GENE not in toolkit.get_children(GENE_OR_GENE_PRODUCT, mixin=False) assert "biolink:Transcript" in toolkit.get_children( - NUCLEIC_ACID_ENTITY, formatted=True + BIOLOGICAL_ENTITY, formatted=True )