Skip to content
Snippets Groups Projects
Commit a2b39603 authored by Kartik Ohri's avatar Kartik Ohri Committed by Phabricator Migration user
Browse files

Fix mypy issues

parent d1924d32
No related branches found
No related tags found
No related merge requests found
import collections import collections
from typing import DefaultDict, Dict, Final, Set, Type from typing import DefaultDict, Dict, Set, Type
import click import click
from typing_extensions import Final
from . import cff, codemeta, maven, npm, python, ruby from . import cff, codemeta, maven, npm, python, ruby
from .base import BaseMapping from .base import BaseMapping
......
from typing import Dict, List, Optional from typing import Any, Dict, List, Optional
import yaml import yaml
...@@ -32,14 +32,14 @@ class CffMapping(DictMapping, SingleFileMapping): ...@@ -32,14 +32,14 @@ class CffMapping(DictMapping, SingleFileMapping):
def normalize_authors(self, d) -> Authors: def normalize_authors(self, d) -> Authors:
result: List[Author] = [] result: List[Author] = []
for author in d: for author in d:
author_data = {"@type": SCHEMA_URI + "Person"} author_data: Dict[str, Any] = {"@type": SCHEMA_URI + "Person"}
if "orcid" in author: if "orcid" in author:
author_data["@id"] = author["orcid"] author_data["@id"] = author["orcid"]
if "affiliation" in author: if "affiliation" in author:
author_data[SCHEMA_URI + "affiliation"] = { author_data[SCHEMA_URI + "affiliation"] = {
"@type": SCHEMA_URI + "Organization", "@type": SCHEMA_URI + "Organization",
SCHEMA_URI + "name": author["affiliation"], SCHEMA_URI + "name": author["affiliation"],
} # type: ignore }
if "family-names" in author: if "family-names" in author:
author_data[SCHEMA_URI + "familyName"] = author["family-names"] author_data[SCHEMA_URI + "familyName"] = author["family-names"]
if "given-names" in author: if "given-names" in author:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment