Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert citation to formatted_citation usage where necessary #666

Merged
merged 7 commits into from
Nov 5, 2024

Conversation

mskarlin
Copy link
Collaborator

@mskarlin mskarlin commented Nov 5, 2024

We were using Doc.citation in our queries, which skipped the extra info from our journal quality and citation count metadata.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Nov 5, 2024
Copy link
Collaborator

@whitead whitead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is missing here - either DocDetails should not allow None citation or Doc should allow None citation. Otherwise we have some weird stuff going on I think

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 5, 2024
@mskarlin
Copy link
Collaborator Author

mskarlin commented Nov 5, 2024

good call -- defaulting to an empty string, which I think should be fine.

Copy link
Collaborator

@jamesbraza jamesbraza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to add a test case for this? Seems niche and an easy place to cause a regression

) -> dict[str, Any]:
if not data.get("journal"):
doi = data.get("doi", "") or ""
if "10.48550/" in doi or "ArXiv" in (data.get("other", {}) or {}).get(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to an external module-level lookup of journal to base DOI?

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 5, 2024
@mskarlin mskarlin merged commit 0baab16 into main Nov 5, 2024
5 checks passed
@mskarlin mskarlin deleted the citation_to_formatted_citation branch November 5, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants