-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publications report for the EDRN Quarterly Report
- Loading branch information
1 parent
466e092
commit 3acbc14
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/edrnsite.policy/src/edrnsite/policy/management/commands/edrn_publications_report.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# encoding: utf-8 | ||
|
||
'''🧬 EDRN Site: Publications Report. | ||
To support reporting of numbers of publications for the EDRN quarterly report. | ||
''' | ||
|
||
from django.core.management.base import BaseCommand | ||
from eke.knowledge.models import Publication | ||
|
||
|
||
class Command(BaseCommand): | ||
'''The EDRN Jackie's report command.''' | ||
|
||
help = 'Report on the numbers of publications' | ||
|
||
def handle(self, *args, **options): | ||
'''Handle the EDRN `edrn_publications_report` command.''' | ||
dmcc_pubs = Publication.objects.filter( | ||
subject_uris__identifier__startswith='http://edrn.nci.nih.gov/data/pubs/' | ||
) | ||
grant_pubs = Publication.objects.filter( | ||
subject_uris__identifier__startswith='urn:edrn:knowledge:publication:via-grants:' | ||
) | ||
|
||
on_page = dmcc_pubs.filter(year__isnull=False).union(grant_pubs.filter(year__isnull=False)).count() | ||
self.stdout.write(f'Reported on Publications page: {on_page}') | ||
self.stdout.write('The number on the publications page includes only those from the DMCC and the grant numbers and omits publications without year-of-publication information and omits those from the BMDB.') | ||
self.stdout.write() | ||
|
||
without_year = dmcc_pubs.union().count() | ||
self.stdout.write(f'Including publications without a year (and not from BMDB): {without_year}') | ||
self.stdout.write() | ||
|
||
total = Publication.objects.count() | ||
self.stdout.write(f'All publications, including those from BMDB: {total}') |