diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3befd09..b1d59bb 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 ./ @@ -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 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) 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)