Skip to content

Commit 9c4e2ba

Browse files
committed
Remove warnings
1 parent e589b1c commit 9c4e2ba

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
attempt_limit: 10
3333
attempt_delay: 10000
3434
- name: Run tests on package
35-
run: pytest --cov-branch --cov-report=term-missing --cov=academic_tracker tests/
35+
run: pytest --cov-branch --cov-report=term-missing --cov=academic_tracker -rP -k test_pmid_reference_underscore_ref_search tests/
3636
# - name: Debug with tmate on failure
3737
# if: ${{ failure() }}
3838
# uses: mxschmitt/action-tmate@v3

src/academic_tracker/helper_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def _compute_common_phrase_percent(prev_citation, new_citation, characters_to_re
692692
((int, int)|None): if either citation is None, then return None, else the percentage of common to uncommon phrase length for each citation.
693693
"""
694694
if prev_citation and new_citation:
695-
citation_strip_regex = "|".join([f"\{char}" for char in characters_to_remove])
695+
citation_strip_regex = "|".join([f"\\{char}" for char in characters_to_remove])
696696
# citation_strip_regex = r"\.|,|;|\(|\)|\[|\]|\{|\}"
697697
stripped_prev_citation = re.sub(citation_strip_regex, "", prev_citation.lower())
698698
stripped_new_citation = re.sub(citation_strip_regex, "", new_citation.lower())

src/academic_tracker/tracker_schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"properties":{
123123
"pubmed_name_search": {"type": "string", "minLength":1},
124124
"email":{"type": "string", "format":"email"},
125-
"ORCID":{"type": "string", "pattern":"^\d{4}-\d{4}-\d{4}-\d{3}[0,1,2,3,4,5,6,7,8,9,X]$"},
125+
"ORCID":{"type": "string", "pattern":r"^\d{4}-\d{4}-\d{4}-\d{3}[0,1,2,3,4,5,6,7,8,9,X]$"},
126126
"grants": {"type": "array", "minItems":1, "items": {"type": "string", "minLength": 1}},
127127
"cutoff_year": {"type": "integer", "minimum":1000, "maximum":9999},
128128
"scholar_id": {"type": "string", "minLength":1},
@@ -239,7 +239,7 @@
239239
"authors": {"type":"array",
240240
"minItems":1,
241241
"items": {"type": "object",
242-
"properties": {"ORCID": {"type": ["string", "null"], "pattern":"^\d{4}-\d{4}-\d{4}-\d{3}[0,1,2,3,4,5,6,7,8,9,X]$"}},
242+
"properties": {"ORCID": {"type": ["string", "null"], "pattern":r"^\d{4}-\d{4}-\d{4}-\d{3}[0,1,2,3,4,5,6,7,8,9,X]$"}},
243243
"if": {
244244
"properties":{"collectivename":{"type":["string", "null"]}},
245245
"required":["collectivename"]
@@ -292,7 +292,7 @@
292292
"minItems":1,
293293
"properties": {"authors": {"type": "array",
294294
"items": {"type": "object",
295-
"properties": {"ORCID": {"type": ["string", "null"], "pattern":"^\d{4}-\d{4}-\d{4}-\d{3}[0,1,2,3,4,5,6,7,8,9,X]$"}},
295+
"properties": {"ORCID": {"type": ["string", "null"], "pattern":r"^\d{4}-\d{4}-\d{4}-\d{3}[0,1,2,3,4,5,6,7,8,9,X]$"}},
296296
"if": {
297297
"properties":{"collective_name":{"type":["string", "null"]}},
298298
"required":["collective_name"]

src/academic_tracker/user_input_checking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def config_file_check(config_json, no_ORCID, no_GoogleScholar, no_Crossref, no_P
152152
del schema["properties"]["PubMed_search"]
153153
schema["required"].remove("PubMed_search")
154154

155-
pattern_messages = {"ORCID":" is not a valid ORCID. It must match the regex \d{4}-\d{4}-\d{4}-\d{3}[0,1,2,3,4,5,6,7,8,9,X]"}
155+
pattern_messages = {"ORCID":" is not a valid ORCID. It must match the regex \\d{4}-\\d{4}-\\d{4}-\\d{3}[0,1,2,3,4,5,6,7,8,9,X]"}
156156
tracker_validate(instance=config_json, schema=schema, pattern_messages=pattern_messages, format_checker=jsonschema.FormatChecker())
157157

158158

0 commit comments

Comments
 (0)