-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging staging branch into prod branch
- Loading branch information
Showing
56 changed files
with
1,227 additions
and
611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 0 additions & 131 deletions
131
backend/cellguide/pipeline/canonical_marker_genes/utils.py
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
backend/cellguide/pipeline/source_collections/source_collections_generator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
def format_citation_dp(message: dict) -> str: | ||
""" | ||
Formats the citation message. | ||
Parameters | ||
---------- | ||
message : dict | ||
The message containing publisher_metadata from the /collections API. | ||
Returns | ||
------- | ||
str | ||
The formatted citation string. | ||
""" | ||
author_str_suffix = "" | ||
if len(message["authors"]) > 1: | ||
author_str_suffix = " et al." | ||
first_author = message["authors"][0] | ||
author_str = f"{first_author['family']}" if "family" in first_author else f"{first_author['name']}" | ||
author_str += author_str_suffix | ||
|
||
journal = message["journal"] if message["journal"] else "" | ||
year = f"{message['published_year']}" | ||
|
||
return f"{author_str} ({year}) {journal}" | ||
|
||
|
||
def format_citation_crossref(message: dict) -> str: | ||
""" | ||
Formats the citation message. | ||
Parameters | ||
---------- | ||
message : dict | ||
The message containing citation details output from CrossRef. | ||
Returns | ||
------- | ||
str | ||
The formatted citation string. | ||
""" | ||
author_str_suffix = "" | ||
if len(message["author"]) > 1: | ||
author_str_suffix = " et al." | ||
first_author = message["author"][0] | ||
author_str = f"{first_author['family']}" if "family" in first_author else f"{first_author['name']}" | ||
author_str += author_str_suffix | ||
|
||
journal = message["container-title"][0] if len(message["container-title"]) else "" | ||
year = message["created"]["date-parts"][0][0] | ||
|
||
return f"{author_str} ({year}) {journal}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.