Skip to content

Check if a journal name starts with the #320

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

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion paperqa/clients/journal_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ async def _process(
# remember, if both have docnames (i.e. key) they are
# wiped and re-generated with resultant data
return doc_details + DocDetails( # type: ignore[call-arg]
source_quality=self.data.get(query.journal.casefold(), -1) # type: ignore[union-attr]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we be using casefold?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so? just to be more robust with journal names. @mskarlin thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yup that's what we've been using on title comparisons!

source_quality=max(
[
self.data.get(query.journal.casefold(), -1), # type: ignore[union-attr]
self.data.get("the " + query.journal.casefold(), -1), # type: ignore[union-attr]
]
)
)

def query_creator(self, doc_details: DocDetails, **kwargs) -> JournalQuery | None:
Expand Down