Skip to content

Commit

Permalink
Merge pull request #157 from biolink/biolink_model_4.0
Browse files Browse the repository at this point in the history
Biolink model 3.6.0 update, and extra dependency resolution action
  • Loading branch information
sierra-moxon authored Nov 29, 2023
2 parents 5cf1a80 + 50ab7e8 commit 9ff97a9
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/check-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions .github/workflows/initialize-toolkit-daily.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion bmt/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/test_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
)


Expand Down

0 comments on commit 9ff97a9

Please sign in to comment.