Skip to content

Commit

Permalink
Add group email field
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Jan 29, 2025
1 parent fa48931 commit be880cc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bioregistry/data/bioregistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -107081,6 +107081,12 @@
}
},
"silva.taxon": {
"contact": {
"email": "[email protected]",
"name": "Lorenz Reimer",
"orcid": "0000-0002-7805-0660"
},
"contact_group": "[email protected]",
"contributor": {
"email": "[email protected]",
"github": "jplfaria",
Expand Down
4 changes: 4 additions & 0 deletions src/bioregistry/schema/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ class Resource(BaseModel):
"person and not be a listserve nor a shared email account."
),
)
contact_group: Optional[str] = Field(
default=None,
description="A group contact email for the project. It's required to have a primary contact to have this field.",
)
owners: Optional[List[Organization]] = Field(
default=None,
description="The owner of the corresponding identifier space. See also https://github.com/biopragmatics/"
Expand Down
16 changes: 16 additions & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,22 @@ def test_contacts(self):
)
self.assert_contact_metadata(resource.contact)

def test_contact_group(self) -> None:
"""Test curation of group emails."""
for prefix, resource in self.registry.items():
if not resource.contact_group:
continue
with self.subTest(prefix=prefix):
self.assertIsNotNone(
resource.get_contact(),
msg="All curated group contacts also require an explicit primary contact. This is to promote transparency and openness.",
)
self.assertRegex(
resource.contact_group,
EMAIL_RE,
msg=f"Group contact email is not a valid email address in {prefix}: {resource.contact_group}",
)

def test_wikidata_wrong_place(self):
"""Test that wikidata annotations aren't accidentally placed in the wrong place."""
registry_raw = json.loads(BIOREGISTRY_PATH.read_text(encoding="utf8"))
Expand Down

0 comments on commit be880cc

Please sign in to comment.