Add article type filtering for PubMed format generation #1163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Previously, PubMed format was being generated for all articles regardless of their document type. However, according to NCBI PubMed documentation, PubMed only accepts specific types of articles for submission.
This was generating unnecessary PubMed XML files for ineligible article types such as book reviews, abstracts, news items, and other document types that PubMed does not accept.
Solution
This PR implements filtering logic to only generate PubMed format for eligible article types:
Eligible article types:
Changes
article/choices.py: AddedPUBMED_ARTICLE_TYPESconstant containing the list of eligible article types based on NCBI guidelinesarticle/models.py: ModifiedArticleFormat.generate_formats()to check the article type before generating PubMed format:article/tests.py: Added comprehensive test suite (PubMedArticleTypeFilteringTest) with 4 test methods to verify:Impact
Fixes the requirement from issue: scieloorg/PC-Programs#3374
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.