Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomzoy committed Oct 16, 2024
1 parent 585b9d2 commit 6852be5
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:

jobs:
Documentation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-22.04, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -42,7 +42,7 @@ jobs:

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

Expand All @@ -58,7 +58,7 @@ jobs:
name: Upload to PyPI

needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/download-artifact@v4
Expand All @@ -76,7 +76,7 @@ jobs:
# repository_url: https://test.pypi.org/legacy/

Documentation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-22.04, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
Expand All @@ -30,7 +30,7 @@ jobs:

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
linting:
name: Linting
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -32,7 +32,7 @@ jobs:

pytest:
name: Pytest
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:

documentation:
name: Documentation
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:

simple-installation:
name: Simple installation
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
Expand Down
6 changes: 3 additions & 3 deletions edsnlp/pipes/ner/behaviors/alcohol/alcohol.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def process(self, doc: Doc) -> List[Span]:
stopped = self.negation.process(span)
if not any(stopped_token.negation for stopped_token in stopped.tokens):
span._.status = 2

if "zero_after" in span._.assigned.keys():
span._.negation = True
else:
if "zero_after" in span._.assigned.keys():
span._.negation = True

yield span
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ def get_matches(self, doc: Doc) -> List[Span]:
def ensure_doc(self, doc: Union[Doc, Span]) -> Doc:
return doc if not hasattr(doc, "as_doc") else doc.as_doc()

def process(self, doc: Doc) -> BaseQualifierResults:
doc = self.ensure_doc(doc) # pragma: no cover
def process(self, doc_like: Union[Doc, Span]) -> BaseQualifierResults:
doc_like = self.ensure_doc(doc_like) # pragma: no cover
raise NotImplementedError

def __call__(self, doc: Doc) -> Doc:
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/family/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def set_extensions(self) -> None:
if not Doc.has_extension("family"):
Doc.set_extension("family", default=[])

def process(self, doc: Doc) -> FamilyResults:
doc = self.ensure_doc(doc)
def process(self, doc_like: Union[Doc, Span]) -> FamilyResults:
doc = self.ensure_doc(doc_like)
matches = self.get_matches(doc)

terminations = [m for m in matches if m.label_ == "termination"]
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/history/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ def set_extensions(self) -> None:
getter=deprecated_getter_factory("antecedent_cues", "history_cues"),
)

def process(self, doc: Doc) -> HistoryResults:
doc = self.ensure_doc(doc)
def process(self, doc_like: Union[Doc, Span]) -> HistoryResults:
doc = self.ensure_doc(doc_like)
note_datetime = None
if doc._.note_datetime is not None:
try:
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/hypothesis/hypothesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ def load_verbs(
list_hypo_verbs_following,
)

def process(self, doc: Doc) -> HypothesisResults:
doc = self.ensure_doc(doc)
def process(self, doc_like: Union[Doc, Span]) -> HypothesisResults:
doc = self.ensure_doc(doc_like)
matches = self.get_matches(doc)

terminations = [m for m in matches if m.label_ == "termination"]
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/negation/negation.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ def __call__(self, doc: Doc) -> Doc:
token._.negation = True
return doc

def process(self, doc: Doc) -> NegationResults:
doc = self.ensure_doc(doc)
def process(self, doc_like: Union[Doc, Span]) -> NegationResults:
doc = self.ensure_doc(doc_like)
matches = self.get_matches(doc)

terminations = [m for m in matches if m.label_ == "termination"]
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/reported_speech/reported_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ def load_verbs(self, verbs: List[str]) -> List[str]:

return list_rep_verbs

def process(self, doc: Doc) -> ReportedSpeechResults:
doc = self.ensure_doc(doc)
def process(self, doc_like: Union[Doc, Span]) -> ReportedSpeechResults:
doc = self.ensure_doc(doc_like)
matches = self.get_matches(doc)
matches += list(self.regex_matcher(doc, as_spans=True))

Expand Down
12 changes: 12 additions & 0 deletions tests/pipelines/ner/disorders/alcohol.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
True,
True,
True,
True,
True,
False,
],
detailled_status=[
None,
Expand All @@ -22,6 +25,9 @@
"ABSTINENCE",
None,
None,
"ABSTINENCE",
None,
None,
],
negation=[
None,
Expand All @@ -34,6 +40,9 @@
None,
True,
False,
False,
False,
None,
],
assign=None,
texts=[
Expand All @@ -47,5 +56,8 @@
"Le patient est en cours de sevrage éthylotabagique",
"Patient alcoolique: non.",
"On a un alcoolique non sevré depuis 10 ans.",
"Alcoolisme sevré",
"Alcoolisme non sevré",
"Dosage vitamines 25-OH",
],
)

0 comments on commit 6852be5

Please sign in to comment.