Skip to content

Commit b7a2ec6

Browse files
Backticks in all docstrings
1 parent 2fb44dd commit b7a2ec6

11 files changed

+115
-114
lines changed

pybliometrics/scopus/abstract_citation.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def authors(self) -> Optional[List[Optional[List[Optional[NamedTuple]]]]]:
1414
"""A list of lists of namedtuples storing author information,
1515
where each namedtuple corresponds to one author and each sub-list to
1616
one document.
17-
The information in each namedtuple is (name surname initials id url).
17+
The information in each namedtuple is `(name surname initials id url)`.
1818
All entries are strings.
1919
"""
2020
outer = []
@@ -24,7 +24,8 @@ def authors(self) -> Optional[List[Optional[List[Optional[NamedTuple]]]]]:
2424
inner = []
2525
for author in doc.get('author', []):
2626
author = {k.split(":", 1)[-1]: v for k, v in author.items()}
27-
new = auth(name=author.get('index-name'), id=author['authid'],
27+
new = auth(name=author.get('index-name'),
28+
id=author['authid'],
2829
surname=author.get('surname'),
2930
initials=author.get('initials'),
3031
url=author.get('author-url'))
@@ -199,17 +200,17 @@ def __init__(self,
199200
citation: Optional[str] = None,
200201
**kwds: str
201202
) -> None:
202-
"""Interaction witht the Citation Overview API.
203+
"""Interaction with the Citation Overview API.
203204
204-
:param identifier: Up to 25 identifiers for which to look up
205+
:param identifier: Up to 25 identifiers for which to look up
205206
citations. Must be Scopus IDs, DOIs, PIIs or
206207
Pubmed IDs.
207208
:param start: The first year for which the citation count should
208209
be loaded.
209210
:param end: The last year for which the citation count should be
210211
loaded. Defaults to the current year.
211212
:param id_type: The type of the IDs provided in `identifier`. Must be
212-
one of "scopus_id", "doi", "pii", "pubmed_id".
213+
one of `"scopus_id", "doi", "pii", "pubmed_id"`.
213214
:param eid: (deprecated) The Scopus ID of the abstract - will be
214215
removed in a future release: Instead use param `scopus_id`
215216
after stripping the part until the second hyphen. If you
@@ -220,7 +221,7 @@ def __init__(self,
220221
number of days since last modification exceeds that value.
221222
:param citation: Allows for the exclusion of self-citations or those
222223
by books. If `None`, will count all citations.
223-
Allowed values: None, exclude-self, exclude-books
224+
Allowed values: `None, exclude-self, exclude-books`
224225
:param kwds: Keywords passed on as query parameters. Must contain
225226
fields and values mentioned in the API specification at
226227
https://dev.elsevier.com/documentation/AbstractCitationAPI.wadl.

pybliometrics/scopus/abstract_retrieval.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def abstract(self) -> Optional[str]:
1818
@property
1919
def affiliation(self) -> Optional[List[NamedTuple]]:
2020
"""A list of namedtuples representing listed affiliations in
21-
the form (id, name, city, country).
21+
the form `(id, name, city, country)`.
2222
"""
2323
out = []
2424
aff = namedtuple('Affiliation', 'id name city country')
@@ -50,10 +50,10 @@ def authkeywords(self) -> Optional[List[str]]:
5050
@property
5151
def authorgroup(self) -> Optional[List[NamedTuple]]:
5252
"""A list of namedtuples representing the article's authors organized
53-
by affiliation, in the form (affiliation_id, dptid, organization,
53+
by affiliation, in the form `(affiliation_id, dptid, organization,
5454
city, postalcode, addresspart, country, collaboration, auid, orcid,
55-
indexed_name, surname, given_name).
56-
If "given_name" is not present, fall back to initials.
55+
indexed_name, surname, given_name)`.
56+
If `given_name` is not present, fall back to initials.
5757
Note: Affiliation information might be missing or mal-assigned even
5858
when it looks correct in the web view. In this case please request
5959
a correction. It is generally missing for collaborations.
@@ -111,8 +111,8 @@ def authorgroup(self) -> Optional[List[NamedTuple]]:
111111
@property
112112
def authors(self) -> Optional[List[NamedTuple]]:
113113
"""A list of namedtuples representing the article's authors, in the
114-
form (auid, indexed_name, surname, given_name, affiliation). In case
115-
multiple affiliation IDs are given, they are joined on ";".
114+
form `(auid, indexed_name, surname, given_name, affiliation)`. In case
115+
multiple affiliation IDs are given, they are joined on `";"`.
116116
Note: The affiliation referred to here is what Scopus' algorithm
117117
determined as the main affiliation. Property `authorgroup` provides
118118
all affiliations.
@@ -146,8 +146,8 @@ def citedby_link(self) -> str:
146146
@property
147147
def chemicals(self) -> Optional[List[NamedTuple]]:
148148
"""List of namedtuples representing chemical entities in the form
149-
(source, chemical_name, cas_registry_number). In case multiple
150-
numbers given, they are joined on ";".
149+
`(source, chemical_name, cas_registry_number)`. In case multiple
150+
numbers given, they are joined on `";"`.
151151
"""
152152
path = ['enhancement', 'chemicalgroup', 'chemicals']
153153
items = listify(chained_get(self._head, path, []))
@@ -209,7 +209,7 @@ def confsponsor(self) -> Optional[Union[List[str], str]]:
209209
@property
210210
def contributor_group(self) -> Optional[List[NamedTuple]]:
211211
"""List of namedtuples representing contributors compiled by Scopus,
212-
in the form (given_name, initials, surname, indexed_name, role).
212+
in the form `(given_name, initials, surname, indexed_name, role)`.
213213
"""
214214
path = ['source', 'contributor-group']
215215
items = listify(chained_get(self._head, path, []))
@@ -240,8 +240,8 @@ def copyright_type(self) -> str:
240240
@property
241241
def correspondence(self) -> Optional[List[NamedTuple]]:
242242
"""List of namedtuples representing the authors to whom correspondence
243-
should be addressed, in the form (surname, initials, organization,
244-
country, city_group). Multiple organziations are joined on semicolon.
243+
should be addressed, in the form ´(surname, initials, organization,
244+
country, city_group)´. Multiple organziations are joined on semicolon.
245245
"""
246246
fields = 'surname initials organization country city_group'
247247
auth = namedtuple('Correspondence', fields)
@@ -310,7 +310,7 @@ def endingPage(self) -> Optional[str]:
310310
@property
311311
def funding(self) -> Optional[List[NamedTuple]]:
312312
"""List of namedtuples parsed funding information in the form
313-
(agency, agency_id, string, funding_id, acronym, country).
313+
`(agency, agency_id, string, funding_id, acronym, country)`.
314314
"""
315315

316316
def _get_funding_id(f_dict: dict) -> list:
@@ -343,7 +343,7 @@ def funding_text(self) -> Optional[str]:
343343

344344
@property
345345
def isbn(self) -> Optional[Tuple[str, ...]]:
346-
"""ISBNs Optional[str] to publicationName as tuple of variying length,
346+
"""ISBNs `Optional[str]` to publicationName as tuple of variying length,
347347
(e.g. ISBN-10 or ISBN-13)."""
348348
isbns = listify(chained_get(self._head, ['source', 'isbn'], []))
349349
if len(isbns) == 0:
@@ -353,7 +353,7 @@ def isbn(self) -> Optional[Tuple[str, ...]]:
353353

354354
@property
355355
def issn(self) -> Optional[NamedTuple]:
356-
"""Namedtuple in the form (print electronic).
356+
"""Namedtuple in the form `(print electronic)`.
357357
Note: If the source has an E-ISSN, the META view will return None.
358358
Use FULL view instead.
359359
"""
@@ -495,9 +495,9 @@ def refcount(self) -> Optional[int]:
495495
@property
496496
def references(self) -> Optional[List[NamedTuple]]:
497497
"""List of namedtuples representing references listed in the document,
498-
in the form (position, id, doi, title, authors, authors_auid,
498+
in the form `(position, id, doi, title, authors, authors_auid,
499499
authors_affiliationid, sourcetitle, publicationyear, coverDate, volume,
500-
issue, first, last, citedbycount, type, text, fulltext).
500+
issue, first, last, citedbycount, type, text, fulltext)`.
501501
502502
`position` is the number at which the reference appears in the
503503
document, `id` is the Scopus ID of the referenced document (EID
@@ -587,7 +587,7 @@ def self_link(self) -> str:
587587
@property
588588
def sequencebank(self) -> Optional[List[NamedTuple]]:
589589
"""List of namedtuples representing biological entities defined or
590-
mentioned in the text, in the form (name, sequence_number, type).
590+
mentioned in the text, in the form `(name, sequence_number, type)`.
591591
"""
592592
path = ['enhancement', 'sequencebanks', 'sequencebank']
593593
items = listify(chained_get(self._head, path, []))
@@ -634,7 +634,7 @@ def startingPage(self) -> Optional[str]:
634634
@property
635635
def subject_areas(self) -> Optional[List[NamedTuple]]:
636636
"""List of namedtuples containing subject areas of the article
637-
in the form (area abbreviation code).
637+
in the form `(area abbreviation code)`.
638638
Note: Requires the FULL view of the article.
639639
"""
640640
area = namedtuple('Area', 'area abbreviation code')

pybliometrics/scopus/affiliation_retrieval.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def identifier(self) -> int:
5757

5858
@property
5959
def name_variants(self) -> List[NamedTuple]:
60-
"""A list of namedtuples representing variants of the affiliation name
60+
"""A list of namedtuples representing variants of the `affiliation_name`
6161
with number of documents referring to this variant.
6262
"""
6363
variant = namedtuple('Variant', 'name doc_count')
@@ -73,7 +73,7 @@ def org_domain(self) -> Optional[str]:
7373
@property
7474
def org_type(self) -> Optional[str]:
7575
"""Type of the affiliation. Requires the STANDARD view and only
76-
present if profile is org profile.
76+
present if `profile` is `org profile`.
7777
"""
7878
return self._profile.get('org-type')
7979

@@ -138,10 +138,10 @@ def __init__(self,
138138
If int is passed, cached file will be refreshed if the
139139
number of days since last modification exceeds that value.
140140
:param view: The view of the file that should be downloaded. Allowed
141-
values: LIGHT, STANDARD, where STANDARD includes all
142-
information of the LIGHT view. For details see
141+
values: `LIGHT`, `STANDARD`, where `STANDARD` includes all
142+
information of the `LIGHT` view. For details see
143143
https://dev.elsevier.com/sc_affil_retrieval_views.html.
144-
Note: Neither the BASIC view nor DOCUMENTS or AUTHORS
144+
Note: Neither the `BASIC` view nor `DOCUMENTS` or `AUTHORS`
145145
views are active, although documented.
146146
:param kwds: Keywords passed on as query parameters. Must contain
147147
fields and values mentioned in the API specification at

pybliometrics/scopus/affiliation_search.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ class AffiliationSearch(Search):
1111
def affiliations(self) -> Optional[List[NamedTuple]]:
1212
"""A list of namedtuples storing affiliation information,
1313
where each namedtuple corresponds to one affiliation.
14-
The information in each namedtuple is (eid name variant documents city
15-
country parent).
14+
The information in each namedtuple is `(eid name variant documents city
15+
country parent)`.
1616
17-
All entries are strings or None. Field "variant" combines variants
18-
of names with a semicolon.
17+
All entries are `strings` or `None`. Field `variant` combines variants
18+
of names with a `";"`.
1919
2020
Raises
2121
------
22-
ValueError
23-
If the elements provided in integrity_fields do not match the
22+
`ValueError`
23+
If the elements provided in `integrity_fields` do not match the
2424
actual field names (listed above).
2525
"""
2626
# Initiate namedtuple with ordered list of fields
@@ -63,16 +63,16 @@ def __init__(self,
6363
:param download: Whether to download results (if they have not been
6464
cached).
6565
:param integrity_fields: Names of fields whose completeness should
66-
be checked. AffiliationSearch will perform
66+
be checked. `AffiliationSearch` will perform
6767
the action specified in `integrity_action`
6868
if elements in these fields are missing.
6969
This helps avoiding idiosynchratically missing
7070
elements that should always be present
7171
(e.g. EID or name).
7272
:param integrity_action: What to do in case integrity of provided fields
7373
cannot be verified. Possible actions:
74-
- "raise": Raise an AttributeError
75-
- "warn": Raise a UserWarning
74+
- `"raise"`: Raise an AttributeError
75+
- `"warn"`: Raise a UserWarning
7676
:param count: (deprecated) The number of entries to be displayed at
7777
once. A smaller number means more queries with each
7878
query having fewer results.
@@ -82,12 +82,12 @@ def __init__(self,
8282
8383
Raises
8484
------
85-
ScopusQueryError
85+
`ScopusQueryError`
8686
If the number of search results exceeds 5000, which is the API's
8787
maximum number of results returned. The error prevents the
8888
download attempt and avoids making use of your API key.
8989
90-
ValueError
90+
`ValueError`
9191
If any of the parameters `integrity_action` or `refresh` is not
9292
one of the allowed values.
9393

0 commit comments

Comments
 (0)