From 643075a3fca68d32a7eef93759da110109931269 Mon Sep 17 00:00:00 2001 From: jenniferjiangkells Date: Thu, 18 Jul 2024 16:41:47 +0100 Subject: [PATCH 1/4] Fixed vtm pipeline name --- src/miade/annotators.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/miade/annotators.py b/src/miade/annotators.py index 20648fb..01ca985 100644 --- a/src/miade/annotators.py +++ b/src/miade/annotators.py @@ -459,9 +459,7 @@ def run_pipeline( concepts = self.postprocess(concepts, note) elif pipe == "deduplicator": concepts = self.deduplicate(concepts, record_concepts) - elif pipe == "add_numbering": - concepts = self.add_numbering_to_name(concepts) - elif pipe == "VTM_converter": + elif pipe == "vtm_converter": concepts = self.convert_VTM_to_VMP_or_text(concepts) elif pipe == "dosage_extractor" and dosage_extractor is not None: concepts = self.add_dosages_to_concepts(dosage_extractor, concepts, note) From 31ee4bac2dbbcf50d4f36fe154deb541d6d3b2ad Mon Sep 17 00:00:00 2001 From: jenniferjiangkells Date: Thu, 18 Jul 2024 16:49:29 +0100 Subject: [PATCH 2/4] Fix ci pip version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3befd09..f1cc8e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: python-version: 3.11 - name: install dependencies run: | - python -m pip install --upgrade pip + python -m pip install pip==24.0 pip install pytest pip install torch --index-url https://download.pytorch.org/whl/cpu pip install ./ From 10815ff4d1f61431541cefb13f05dd072f895cc7 Mon Sep 17 00:00:00 2001 From: jenniferjiangkells Date: Thu, 18 Jul 2024 17:02:30 +0100 Subject: [PATCH 3/4] Add continue on error option in ci --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1cc8e8..b1d59bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,4 +34,7 @@ jobs: - name: install ruff run: pip install ruff - name: ruff format - run: ruff format --check . + run: | + ruff format + ruff check --fix + continue-on-error: true From 913dbd8e155d3a3a3d6ca8ed5a3f235d28511e68 Mon Sep 17 00:00:00 2001 From: jenniferjiangkells Date: Thu, 18 Jul 2024 17:02:54 +0100 Subject: [PATCH 4/4] Linting --- src/miade/model_builders/preprocess_snomeduk.py | 2 +- src/miade/utils/logger.py | 4 ++-- tests/conftest.py | 2 +- tests/test_core.py | 1 - tests/test_note.py | 5 ++--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/miade/model_builders/preprocess_snomeduk.py b/src/miade/model_builders/preprocess_snomeduk.py index 11242e8..89f338a 100644 --- a/src/miade/model_builders/preprocess_snomeduk.py +++ b/src/miade/model_builders/preprocess_snomeduk.py @@ -1,5 +1,5 @@ """This module is essentially the same as the MedCAT util preprocess_snomed.py - with a few minor changes adapted to reading snomed UK folder paths""" +with a few minor changes adapted to reading snomed UK folder paths""" import os import re diff --git a/src/miade/utils/logger.py b/src/miade/utils/logger.py index a1cad54..787cc52 100644 --- a/src/miade/utils/logger.py +++ b/src/miade/utils/logger.py @@ -1,5 +1,5 @@ -"""Loggers -""" +"""Loggers""" + import logging diff --git a/tests/conftest.py b/tests/conftest.py index a1d17a9..ef6f4f5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -178,7 +178,7 @@ def test_clean_and_paragraphing_note() -> Note: return Note( """ This is an example of text with various types of spaces: -\tTabs, \u00A0Non-breaking spaces, \u2003Em spaces, \u2002En spaces. +\tTabs, \u00a0Non-breaking spaces, \u2003Em spaces, \u2002En spaces. Some lines may contain only punctuation and spaces, like this: !? ... - -- ??? \n diff --git a/tests/test_core.py b/tests/test_core.py index d3da188..61eb14e 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1,6 +1,5 @@ from miade.core import NoteProcessor from miade.concept import Concept, Category -from miade.annotators import Annotator from miade.metaannotations import MetaAnnotations from miade.utils.metaannotationstypes import ( Presence, diff --git a/tests/test_note.py b/tests/test_note.py index 0be1ea6..aaef5a3 100644 --- a/tests/test_note.py +++ b/tests/test_note.py @@ -1,5 +1,4 @@ -from miade.annotators import Annotator, MedsAllergiesAnnotator, ProblemsAnnotator -from miade.core import NoteProcessor +from miade.annotators import MedsAllergiesAnnotator, ProblemsAnnotator from miade.concept import Concept, Category from miade.paragraph import Paragraph, ParagraphType from miade.metaannotations import MetaAnnotations @@ -66,7 +65,7 @@ def test_prob_paragraph_note( ] -def test_prob_paragraph_note( +def test_med_paragraph_note( test_meds_algy_medcat_model, test_clean_and_paragraphing_note, test_paragraph_chunking_med_concepts ): annotator = MedsAllergiesAnnotator(test_meds_algy_medcat_model)