From f2faef4423405580aebb72b8cd42e1fb4225cbfe Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 3 Sep 2024 14:56:15 +0200 Subject: [PATCH] Minor curations and code updates (#1178) * Add pattern and URI format to CRediT * Add wikidata link for Publons Researcher ID * Add Mastodon prefix * Update bioregistry.json * Use UV for tests * Update mypy --- .github/workflows/tests.yml | 13 ++---- src/bioregistry/analysis/paper_ranking.py | 4 +- src/bioregistry/data/bioregistry.json | 57 +++++++++++++++++++++-- tox.ini | 3 +- 4 files changed, 61 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 468090af3..b42f78716 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,8 +21,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install --upgrade pip setuptools wheel - pip install tox + pip install tox tox-uv - name: Check manifest run: tox -e manifest - name: Check code quality with flake8 @@ -36,7 +35,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.10" ] + python-version: [ "3.12" ] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -45,8 +44,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install --upgrade pip setuptools wheel - pip install tox + pip install tox tox-uv - name: Check RST conformity with doc8 run: tox -e doc8 - name: Check docstring coverage @@ -59,7 +57,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest ] - python-version: [ "3.11", "3.8" ] + python-version: [ "3.12", "3.8" ] pydantic: [ "pydantic1", "pydantic2" ] steps: - uses: actions/checkout@v2 @@ -69,8 +67,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install --upgrade pip setuptools wheel - pip install tox + pip install tox tox-uv - name: Test with pytest run: tox -e py-${{ matrix.pydantic }} diff --git a/src/bioregistry/analysis/paper_ranking.py b/src/bioregistry/analysis/paper_ranking.py index 2c5497d8a..3511e883f 100644 --- a/src/bioregistry/analysis/paper_ranking.py +++ b/src/bioregistry/analysis/paper_ranking.py @@ -332,8 +332,8 @@ def main(bioregistry_file, start_date, end_date): click.echo(f"Writing evaluation to {evaluation_path}") evaluation_df.to_csv(evaluation_path, sep="\t", index=False) - random_forest_clf: RandomForestClassifier = classifiers[0][1] - lr_clf: LogisticRegression = classifiers[1][1] + random_forest_clf = classifiers[0][1] + lr_clf = classifiers[1][1] importances_df = ( pd.DataFrame( list( diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json index 8cdf48375..5c1391992 100644 --- a/src/bioregistry/data/bioregistry.json +++ b/src/bioregistry/data/bioregistry.json @@ -22123,6 +22123,11 @@ "uri_format": "https://crates.io/crates/$1" }, "credit": { + "contact": { + "email": "liz.allen@f1000.com", + "name": "Liz Allen", + "orcid": "0000-0002-9298-3168" + }, "contributor": { "email": "cthoyt@gmail.com", "github": "cthoyt", @@ -22130,7 +22135,7 @@ "orcid": "0000-0003-4423-4370" }, "description": "CRediT (Contributor Roles Taxonomy) is high-level taxonomy, including 14 roles, that can be used to represent the roles typically played by contributors to scientific scholarly output. The roles describe each contributor’s specific contribution to the scholarly output.", - "example": "Software", + "example": "software", "fairsharing": { "abbreviation": "CRediT", "contact": { @@ -22183,11 +22188,12 @@ ], "twitter": "contrib_roles" }, - "homepage": "https://casrai.org/credit/", + "homepage": "https://credit.niso.org/", "mappings": { "fairsharing": "FAIRsharing.fe4816" }, "name": "CASRAI Contributor Roles Taxonomy", + "pattern": "^(conceptualization|data-curation|formal-analysis|funding-acquisition|investigation|methodology|project-administration|resources|software|supervision|validation|visualization|writing-original-draft|writing-review-editing)$", "publications": [ { "doi": "10.1038/d41586-019-01715-4", @@ -22215,7 +22221,11 @@ "title": "How can we ensure visibility and diversity in research contributions? How the Contributor Role Taxonomy (CRediT) is helping the shift from authorship to contributorship", "year": 2019 } - ] + ], + "references": [ + "https://casrai.org/credit/" + ], + "uri_format": "https://credit.niso.org/contributor-roles/$1" }, "crisprdb": { "biocontext": { @@ -63630,6 +63640,30 @@ "uri_format": "https://massive.ucsd.edu/ProteoSAFe/protein_explorer.jsp?libraries=2&protein_name=$1" } }, + "mastodon": { + "contributor": { + "email": "cthoyt@gmail.com", + "github": "cthoyt", + "name": "Charles Tapley Hoyt", + "orcid": "0000-0003-4423-4370" + }, + "homepage": "https://mastodon.social", + "mappings": { + "wikidata": "P4033" + }, + "name": "Mastodon", + "wikidata": { + "description": "address on the Mastodon decentralized social network (the form is 'user@server.domain' without a leading '@')", + "example": [ + "jz@mamot.fr", + "libreoffice@fosstodon.org" + ], + "name": "Mastodon address", + "pattern": "^[A-Za-z0-9_]+([A-Za-z0-9_\\.]+[A-Za-z0-9_]+)?@[\\d\\w\\.\\-]+[0-9a-z]+$", + "prefix": "P4033", + "uri_format": "https://fedirect.toolforge.org/?id=$1" + } + }, "mat": { "aberowl": { "description": "Minimal set of terms for anatomy", @@ -94174,11 +94208,24 @@ "example": "1981638", "homepage": "https://publons.com/researcher", "mappings": { - "biolink": "ResearchID" + "biolink": "ResearchID", + "wikidata": "P3829" }, "name": "Publons Researcher", "pattern": "^\\d+$", - "uri_format": "https://publons.com/researcher/$1" + "uri_format": "https://publons.com/researcher/$1", + "wikidata": { + "description": "identifier of an author or reviewer, in Publons that redirects, along with P1053, to an ID in Clarivate's Web of Science", + "example": [ + "2388520", + "2544783", + "654601" + ], + "name": "Publons author ID", + "pattern": "^\\d+$", + "prefix": "P3829", + "uri_format": "https://publons.com/researcher/$1/" + } }, "pubmed": { "biocontext": { diff --git a/tox.ini b/tox.ini index b31451cff..e86cf05a2 100644 --- a/tox.ini +++ b/tox.ini @@ -125,8 +125,9 @@ deps = types-Markdown types-tabulate types-requests + types-python-dateutil skip_install = true -commands = mypy --install-types --non-interactive --ignore-missing-imports src/bioregistry/ +commands = mypy --ignore-missing-imports src/bioregistry/ description = Run the mypy tool to check static typing on the project. [testenv:pyroma]