From 9adaf9344ac380407c12e77046096cf0ae4f7a76 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Mon, 30 Oct 2023 16:55:00 +0100 Subject: [PATCH 01/10] Add upper- and lowercase prefix synonyms Closes #935 --- src/bioregistry/record_accumulator.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/bioregistry/record_accumulator.py b/src/bioregistry/record_accumulator.py index 34ada8855..eab4c7047 100644 --- a/src/bioregistry/record_accumulator.py +++ b/src/bioregistry/record_accumulator.py @@ -170,14 +170,15 @@ def _add_primary_prefix(prefix: str) -> Optional[str]: return primary_prefix def _add_synonym(*, synonym: str, prefix: str) -> None: - if synonym in reverse_prefix_lookup: - if reverse_prefix_lookup[synonym] == prefix: + for s in [synonym, synonym.lower(), synonym.upper()]: + if s in reverse_prefix_lookup: + if reverse_prefix_lookup[s] == prefix: + return + msg = f"duplicate prefix in {reverse_prefix_lookup[s]} and {prefix}: {s}" + _debug_or_raise(msg, strict=strict) return - msg = f"duplicate prefix in {reverse_prefix_lookup[synonym]} and {prefix}: {synonym}" - _debug_or_raise(msg, strict=strict) - return - reverse_prefix_lookup[synonym] = prefix - secondary_prefixes[prefix].add(synonym) + reverse_prefix_lookup[s] = prefix + secondary_prefixes[prefix].add(s) def _add_uri_synonym(*, uri_prefix: str, prefix: str) -> None: if (prefix, uri_prefix) in prefix_resource_blacklist: From 6fdc65ff6d608352579970cf90f40a6520186615 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Thu, 2 Nov 2023 09:25:50 +0100 Subject: [PATCH 02/10] Add synonyms in practice --- src/bioregistry/record_accumulator.py | 2 ++ tests/test_contexts.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/bioregistry/record_accumulator.py b/src/bioregistry/record_accumulator.py index 58c26bdf3..a69764c37 100644 --- a/src/bioregistry/record_accumulator.py +++ b/src/bioregistry/record_accumulator.py @@ -226,6 +226,8 @@ def _add_prefix_prefixes( primary_prefix = _add_primary_prefix(resource.prefix) if primary_prefix is None: continue + # TODO fix next line, since it seems to delete PUBMED from the OBO EPM + _add_synonym(synonym=resource.prefix, prefix=resource.prefix) for synonym in resource.get_synonyms(): _add_synonym(synonym=synonym, prefix=resource.prefix) for uri_prefix in resource.get_uri_prefixes(): diff --git a/tests/test_contexts.py b/tests/test_contexts.py index 7a45ba744..6949cd62c 100644 --- a/tests/test_contexts.py +++ b/tests/test_contexts.py @@ -57,14 +57,17 @@ def test_obo_context(self): msg="When overriding, this means that bioregistry prefix isn't properly added to the synonyms list", ) - def get_obo_converter(self): + def test_get_obo_converter(self): """Test getting a converter from a context.""" converter = manager.get_converter_from_context("obo") - self.assertEqual("GO", converter.standardize_prefix("GO")) - self.assertEqual("GO", converter.standardize_prefix("gomf")) - # FIXME later, handle adding canonical bioregistry prefix - # as synonym when non-default prefix priority ordering is given - # self.assertEqual("GO", converter.standardize_prefix("go")) + self.assertEqual("GO", converter.standardize_prefix("GO", strict=True)) + self.assertEqual("GO", converter.standardize_prefix("gomf", strict=True)) + self.assertEqual("GO", converter.standardize_prefix("go", strict=True)) + self.assertEqual("PMID", converter.standardize_prefix("pmid", strict=True)) + self.assertEqual("PMID", converter.standardize_prefix("pubmed", strict=True)) + self.assertEqual("PMID", converter.standardize_prefix("PubMed", strict=True)) + # self.assertEqual("PMID", converter.standardize_prefix("PUBMED")) + # self.assertEqual("PMID", converter.standardize_prefix("PMID")) def test_data(self): """Test the data integrity.""" From 1c26a523b947ef000eb0c16f3a7bde8ff3b6617c Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Thu, 2 Nov 2023 09:59:46 +0100 Subject: [PATCH 03/10] Clean up case logic --- src/bioregistry/record_accumulator.py | 48 ++++++++++++++++++--------- tests/test_contexts.py | 5 +-- tests/test_manager.py | 15 +++++++++ 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/src/bioregistry/record_accumulator.py b/src/bioregistry/record_accumulator.py index a69764c37..c6e96e24a 100644 --- a/src/bioregistry/record_accumulator.py +++ b/src/bioregistry/record_accumulator.py @@ -175,15 +175,14 @@ def _add_primary_prefix(prefix: str) -> Optional[str]: return primary_prefix def _add_synonym(*, synonym: str, prefix: str) -> None: - for s in [synonym, synonym.lower(), synonym.upper()]: - if s in reverse_prefix_lookup: - if reverse_prefix_lookup[s] == prefix: - return - msg = f"duplicate prefix in {reverse_prefix_lookup[s]} and {prefix}: {s}" - _debug_or_raise(msg, strict=strict) + if synonym in reverse_prefix_lookup: + if reverse_prefix_lookup[synonym] == prefix: return - reverse_prefix_lookup[s] = prefix - secondary_prefixes[prefix].add(s) + msg = f"duplicate prefix in {reverse_prefix_lookup[synonym]} and {prefix}: {synonym}" + _debug_or_raise(msg, strict=strict) + return + reverse_prefix_lookup[synonym] = prefix + secondary_prefixes[prefix].add(synonym) def _add_uri_synonym(*, uri_prefix: str, prefix: str) -> None: if (prefix, uri_prefix) in prefix_resource_blacklist: @@ -226,8 +225,6 @@ def _add_prefix_prefixes( primary_prefix = _add_primary_prefix(resource.prefix) if primary_prefix is None: continue - # TODO fix next line, since it seems to delete PUBMED from the OBO EPM - _add_synonym(synonym=resource.prefix, prefix=resource.prefix) for synonym in resource.get_synonyms(): _add_synonym(synonym=synonym, prefix=resource.prefix) for uri_prefix in resource.get_uri_prefixes(): @@ -304,12 +301,31 @@ def _add_prefix_prefixes( primary_uri_prefix = primary_uri_prefixes[prefix] if not primary_prefix or not primary_uri_prefix: continue - records[prefix] = curies.Record( - prefix=primary_prefix, - prefix_synonyms=sorted(secondary_prefixes[prefix] - {primary_prefix}), - uri_prefix=primary_uri_prefix, - uri_prefix_synonyms=sorted(secondary_uri_prefixes[prefix] - {primary_uri_prefix}), - pattern=pattern_map.get(prefix), + records[prefix] = _enrich_synonyms( + curies.Record( + prefix=primary_prefix, + prefix_synonyms=sorted(secondary_prefixes[prefix] - {primary_prefix}), + uri_prefix=primary_uri_prefix, + uri_prefix_synonyms=sorted(secondary_uri_prefixes[prefix] - {primary_uri_prefix}), + pattern=pattern_map.get(prefix), + ) ) return [record for _, record in sorted(records.items())] + + +def _enrich_synonyms(record: curies.Record) -> curies.Record: + sss = set() + for s in [record.prefix, *record.prefix_synonyms]: + sss.update(_generate_variants(s)) + record.prefix_synonyms = sorted(sss - {record.prefix}) + return record + + +def _generate_variants(s: str) -> List[str]: + yield s + yield s.lower() + yield s.upper() + yield s.replace("_", "") + yield s.replace("_", "").upper() + yield s.replace("_", "").lower() diff --git a/tests/test_contexts.py b/tests/test_contexts.py index 6949cd62c..a8ce4c4f3 100644 --- a/tests/test_contexts.py +++ b/tests/test_contexts.py @@ -57,6 +57,7 @@ def test_obo_context(self): msg="When overriding, this means that bioregistry prefix isn't properly added to the synonyms list", ) + @pytest.mark.slow def test_get_obo_converter(self): """Test getting a converter from a context.""" converter = manager.get_converter_from_context("obo") @@ -66,8 +67,8 @@ def test_get_obo_converter(self): self.assertEqual("PMID", converter.standardize_prefix("pmid", strict=True)) self.assertEqual("PMID", converter.standardize_prefix("pubmed", strict=True)) self.assertEqual("PMID", converter.standardize_prefix("PubMed", strict=True)) - # self.assertEqual("PMID", converter.standardize_prefix("PUBMED")) - # self.assertEqual("PMID", converter.standardize_prefix("PMID")) + self.assertEqual("PMID", converter.standardize_prefix("PUBMED")) + self.assertEqual("PMID", converter.standardize_prefix("PMID")) def test_data(self): """Test the data integrity.""" diff --git a/tests/test_manager.py b/tests/test_manager.py index a79698563..578e120c4 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -4,6 +4,8 @@ import unittest +import pytest + import bioregistry from bioregistry import Manager, parse_curie from bioregistry.export.rdf_export import get_full_rdf @@ -261,3 +263,16 @@ def test_external_registry_mappings(self): self.assertIn("loggerhead", res.source_only) # This is a non-ontology so it won't get in OBO Foundry self.assertIn("DCTERMS", res.target_only) + + @pytest.mark.slow + def test_converter(self): + """Test standardizing prefixes with the converter.""" + converter = self.manager.get_converter() + self.assertEqual("meddra", converter.standardize_prefix("MEDDRA")) + self.assertEqual("meddra", converter.standardize_prefix("MedDRA")) + + self.assertEqual("pubmed", converter.standardize_prefix("PMID")) + self.assertEqual("pubmed", converter.standardize_prefix("PUBMED")) + self.assertEqual("pubmed", converter.standardize_prefix("pmid")) + self.assertEqual("pubmed", converter.standardize_prefix("pubmed")) + self.assertEqual("pubmed", converter.standardize_prefix("PubMed")) From 3594c86eee90f3e5c5baed54359de58e5d4c7f6b Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Thu, 2 Nov 2023 10:08:05 +0100 Subject: [PATCH 04/10] Add additional integrity check --- src/bioregistry/record_accumulator.py | 26 ++++++++++++++++++-------- tests/test_contexts.py | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/bioregistry/record_accumulator.py b/src/bioregistry/record_accumulator.py index c6e96e24a..9e3cbe075 100644 --- a/src/bioregistry/record_accumulator.py +++ b/src/bioregistry/record_accumulator.py @@ -3,6 +3,7 @@ import itertools as itt import logging from collections import defaultdict +import collections from typing import ( Collection, DefaultDict, @@ -15,6 +16,7 @@ Set, Tuple, cast, + Counter, ) import curies @@ -129,6 +131,14 @@ def get_records( # noqa: C901 or resource.get_priority_prefix(priority=prefix_priority) for resource in resource_dict.values() } + counter = collections.Counter( + v.lower() + for v in primary_prefixes.values() + ) + counter= collections.Counter({k:v for k,v in counter.items() if v > 1}) + if counter: + raise ValueError(f"Duplicate prefixes: {counter}") + pattern_map = { prefix: pattern for prefix in primary_prefixes @@ -301,15 +311,15 @@ def _add_prefix_prefixes( primary_uri_prefix = primary_uri_prefixes[prefix] if not primary_prefix or not primary_uri_prefix: continue - records[prefix] = _enrich_synonyms( - curies.Record( - prefix=primary_prefix, - prefix_synonyms=sorted(secondary_prefixes[prefix] - {primary_prefix}), - uri_prefix=primary_uri_prefix, - uri_prefix_synonyms=sorted(secondary_uri_prefixes[prefix] - {primary_uri_prefix}), - pattern=pattern_map.get(prefix), - ) + record = curies.Record( + prefix=primary_prefix, + prefix_synonyms=sorted(secondary_prefixes[prefix] - {primary_prefix}), + uri_prefix=primary_uri_prefix, + uri_prefix_synonyms=sorted(secondary_uri_prefixes[prefix] - {primary_uri_prefix}), + pattern=pattern_map.get(prefix), ) + record = _enrich_synonyms(record) + records[prefix] = record return [record for _, record in sorted(records.items())] diff --git a/tests/test_contexts.py b/tests/test_contexts.py index a8ce4c4f3..ddc373dc3 100644 --- a/tests/test_contexts.py +++ b/tests/test_contexts.py @@ -9,6 +9,8 @@ from bioregistry import Resource, manager from bioregistry.constants import CONTEXTS_PATH +import pytest + class TestContexts(unittest.TestCase): """A test case for checking the integrity of the contexts.""" From a00452f9e91a060c37fad95f03672328a91e71df Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Thu, 2 Nov 2023 10:24:01 +0100 Subject: [PATCH 05/10] Update test_contexts.py --- tests/test_contexts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_contexts.py b/tests/test_contexts.py index ddc373dc3..d317e12b9 100644 --- a/tests/test_contexts.py +++ b/tests/test_contexts.py @@ -5,12 +5,12 @@ import json import unittest +import pytest + import bioregistry from bioregistry import Resource, manager from bioregistry.constants import CONTEXTS_PATH -import pytest - class TestContexts(unittest.TestCase): """A test case for checking the integrity of the contexts.""" From edccb15243c9a24ae1bd797327dbc1afc1d6fe5d Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Thu, 2 Nov 2023 10:24:19 +0100 Subject: [PATCH 06/10] Update record_accumulator.py --- src/bioregistry/record_accumulator.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/bioregistry/record_accumulator.py b/src/bioregistry/record_accumulator.py index 9e3cbe075..182176deb 100644 --- a/src/bioregistry/record_accumulator.py +++ b/src/bioregistry/record_accumulator.py @@ -3,7 +3,6 @@ import itertools as itt import logging from collections import defaultdict -import collections from typing import ( Collection, DefaultDict, @@ -16,7 +15,6 @@ Set, Tuple, cast, - Counter, ) import curies @@ -131,13 +129,12 @@ def get_records( # noqa: C901 or resource.get_priority_prefix(priority=prefix_priority) for resource in resource_dict.values() } - counter = collections.Counter( - v.lower() - for v in primary_prefixes.values() - ) - counter= collections.Counter({k:v for k,v in counter.items() if v > 1}) - if counter: - raise ValueError(f"Duplicate prefixes: {counter}") + dd = defaultdict(list) + for k, v in primary_prefixes.items(): + dd[v.lower()].append(k) + dd = {k: v for k, v in dd.items() if len(v) > 1} + if dd: + raise ValueError(f"Duplicate prefixes: {dd}") pattern_map = { prefix: pattern From b6ed42b55d82a1328018179da91ff4493e8f3a7d Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Thu, 2 Nov 2023 13:32:49 +0100 Subject: [PATCH 07/10] Update test_contexts.py --- tests/test_contexts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_contexts.py b/tests/test_contexts.py index f79714eb6..08cc29d20 100644 --- a/tests/test_contexts.py +++ b/tests/test_contexts.py @@ -61,13 +61,14 @@ def test_obo_context(self): ) @pytest.mark.slow - def test_get_obo_converter(self): + def test_obo_converter(self): """Test getting a converter from a context.""" converter = manager.get_converter_from_context("obo") self.assertEqual("ICD10WHO", converter.standardize_prefix("icd10")) self.assertEqual("Orphanet", converter.standardize_prefix("ordo")) self.assertEqual("GO", converter.standardize_prefix("GO", strict=True)) self.assertEqual("GO", converter.standardize_prefix("gomf", strict=True)) + self.assertEqual("https://www.ncbi.nlm.nih.gov/pubmed/", converter.bimap["PMID"]) self.assertEqual("GO", converter.standardize_prefix("go", strict=True)) self.assertEqual("PMID", converter.standardize_prefix("pmid", strict=True)) self.assertEqual("PMID", converter.standardize_prefix("pubmed", strict=True)) From 0004f346e4a0fe16b47248e84d21283273a4f26d Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Thu, 2 Nov 2023 15:21:58 +0100 Subject: [PATCH 08/10] Update --- src/bioregistry/data/bioregistry.json | 4 +++- src/bioregistry/data/contexts.json | 7 +++++- src/bioregistry/record_accumulator.py | 18 ++++++--------- tests/test_contexts.py | 32 ++++----------------------- 4 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json index e0b9e0691..993f018a3 100644 --- a/src/bioregistry/data/bioregistry.json +++ b/src/bioregistry/data/bioregistry.json @@ -33721,7 +33721,6 @@ "name": "Drosophila Phenotype Ontology", "prefix": "FBcv" }, - "part_of": "flybase", "pattern": "^\\d{7}$", "prefixcommons": { "bioportal": "1017", @@ -38805,6 +38804,9 @@ "Phenomics", "Comparative Genomics", "Omics" + ], + "synonyms": [ + "GEO" ] }, "go": { diff --git a/src/bioregistry/data/contexts.json b/src/bioregistry/data/contexts.json index 8195c1053..a3147ae50 100644 --- a/src/bioregistry/data/contexts.json +++ b/src/bioregistry/data/contexts.json @@ -1,7 +1,9 @@ { "obo": { "blacklist": [ - "icd9" + "icd9", + "orphanet", + "gro" ], "custom_prefix_map": { "PMID": "https://www.ncbi.nlm.nih.gov/pubmed/" @@ -29,8 +31,11 @@ "default" ], "prefix_remapping": { + "GEO": "ncbi.geo", "ensembl": "ENSEMBL", + "geogeo": "GEO", "icd10": "ICD10WHO", + "cpga": "GRO", "orphanet.ordo": "Orphanet", "pubmed": "PMID", "snomedct": "SCTID", diff --git a/src/bioregistry/record_accumulator.py b/src/bioregistry/record_accumulator.py index c9113387f..aed1aeea1 100644 --- a/src/bioregistry/record_accumulator.py +++ b/src/bioregistry/record_accumulator.py @@ -133,6 +133,7 @@ def get_converter( converter = curies.remap_curie_prefixes(converter, remapping) if rewiring: converter = curies.rewire(converter, rewiring) + converter = _enrich_converter_synonyms(converter) return converter @@ -159,13 +160,6 @@ def _get_records( # noqa: C901 resource.prefix: resource.get_priority_prefix(priority=prefix_priority) for resource in resource_dict.values() } - dd = defaultdict(list) - for k, v in primary_prefixes.items(): - dd[v.lower()].append(k) - dd = {k: v for k, v in dd.items() if len(v) > 1} - if dd: - raise ValueError(f"Duplicate prefixes: {dd}") - pattern_map = { prefix: pattern for prefix in primary_prefixes @@ -338,20 +332,22 @@ def _add_prefix_prefixes( primary_uri_prefix = primary_uri_prefixes[prefix] if not primary_prefix or not primary_uri_prefix: continue - record = curies.Record( + records[prefix] = curies.Record( prefix=primary_prefix, prefix_synonyms=sorted(secondary_prefixes[prefix] - {primary_prefix}), uri_prefix=primary_uri_prefix, uri_prefix_synonyms=sorted(secondary_uri_prefixes[prefix] - {primary_uri_prefix}), pattern=pattern_map.get(prefix), ) - record = _enrich_synonyms(record) - records[prefix] = record return [record for _, record in sorted(records.items())] -def _enrich_synonyms(record: curies.Record) -> curies.Record: +def _enrich_converter_synonyms(converter: Converter) -> Converter: + return Converter([_enrich_record_synonyms(r) for r in converter.records]) + + +def _enrich_record_synonyms(record: curies.Record) -> curies.Record: sss = set() for s in [record.prefix, *record.prefix_synonyms]: sss.update(_generate_variants(s)) diff --git a/tests/test_contexts.py b/tests/test_contexts.py index 08cc29d20..de677c2e5 100644 --- a/tests/test_contexts.py +++ b/tests/test_contexts.py @@ -8,6 +8,7 @@ import pytest import bioregistry +import curies from bioregistry import Resource, manager from bioregistry.constants import CONTEXTS_PATH @@ -46,6 +47,8 @@ def test_obo_context(self): self.assertEqual(f"{p}/KISAO_", prefix_map["KISAO"]) self.assertIn("FBcv", prefix_map) self.assertEqual(f"{p}/FBcv_", prefix_map["FBcv"]) + self.assertNotIn("geo", prefix_map) + self.assertIn("ncbi.geo", prefix_map) self.assertIn("GEO", prefix_map) self.assertEqual(f"{p}/GEO_", prefix_map["GEO"]) self.assertEqual("https://www.ncbi.nlm.nih.gov/pubmed/", prefix_map["PMID"]) @@ -102,36 +105,9 @@ def test_data(self): self.valid_metaprefixes.union({"obofoundry.preferred", "preferred", "default"}), ) remapping = context.prefix_remapping or {} - _valid_remapping_prefixes = set( - bioregistry.get_prefix_map( - uri_prefix_priority=context.uri_prefix_priority, - ) - ) + _valid_remapping_prefixes = set(manager.converter.prefix_map) for prefix in remapping: - # Currently this allows overwriting of existing prefixes self.assertIn(prefix, _valid_remapping_prefixes) - _valid_custom_prefixes = set( - bioregistry.get_prefix_map( - remapping=remapping, - uri_prefix_priority=context.uri_prefix_priority, - ) - ) - invalid_custom_prefixes = { - prefix - for prefix in (context.custom_prefix_map or {}) - if prefix not in _valid_custom_prefixes - } - self.assertEqual( - 0, - len(invalid_custom_prefixes), - msg=f""" - - All prefixes in the custom prefix mapping should either be canonical prefixes or generated by the prefix remapping - - Invalid prefixes: {", ".join(sorted(invalid_custom_prefixes))} -""", - ) - for blacklist_prefix in context.blacklist or []: self.assertIn(blacklist_prefix, self.valid_prefixes) From 15cdcfcf5b39b78ccfdc37247822ed56fa779fd9 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 7 Nov 2023 12:40:59 +0100 Subject: [PATCH 09/10] Cleanup --- src/bioregistry/data/contexts.json | 2 +- tests/test_contexts.py | 1 - tox.ini | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bioregistry/data/contexts.json b/src/bioregistry/data/contexts.json index a3147ae50..b4578aa25 100644 --- a/src/bioregistry/data/contexts.json +++ b/src/bioregistry/data/contexts.json @@ -32,10 +32,10 @@ ], "prefix_remapping": { "GEO": "ncbi.geo", + "cpga": "GRO", "ensembl": "ENSEMBL", "geogeo": "GEO", "icd10": "ICD10WHO", - "cpga": "GRO", "orphanet.ordo": "Orphanet", "pubmed": "PMID", "snomedct": "SCTID", diff --git a/tests/test_contexts.py b/tests/test_contexts.py index de677c2e5..ede584073 100644 --- a/tests/test_contexts.py +++ b/tests/test_contexts.py @@ -8,7 +8,6 @@ import pytest import bioregistry -import curies from bioregistry import Resource, manager from bioregistry.constants import CONTEXTS_PATH diff --git a/tox.ini b/tox.ini index b48cbcc7f..2d8fe20a2 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ envlist = [testenv] commands = - coverage run -p -m pytest --durations=20 {posargs:tests} + coverage run -p -m pytest --durations=20 --disable-warnings {posargs:tests} coverage combine coverage xml deps = From 9752850a26dd1ef969c21a7da21b545f6515dd90 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 22 Nov 2023 01:29:14 +0100 Subject: [PATCH 10/10] Update record_accumulator.py --- src/bioregistry/record_accumulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bioregistry/record_accumulator.py b/src/bioregistry/record_accumulator.py index aed1aeea1..87d8af919 100644 --- a/src/bioregistry/record_accumulator.py +++ b/src/bioregistry/record_accumulator.py @@ -355,7 +355,7 @@ def _enrich_record_synonyms(record: curies.Record) -> curies.Record: return record -def _generate_variants(s: str) -> List[str]: +def _generate_variants(s: str): yield s yield s.lower() yield s.upper()