diff --git a/regolith/builders/grantreportbuilder.py b/regolith/builders/grantreportbuilder.py index aea226b50..9fc19c37d 100644 --- a/regolith/builders/grantreportbuilder.py +++ b/regolith/builders/grantreportbuilder.py @@ -1,23 +1,18 @@ """Builder for Grant Reports""" from datetime import date -import time # from habanero import Crossref from nameparser import HumanName import dateutil.parser as date_parser from regolith.builders.basebuilder import LatexBuilderBase -from regolith.dates import month_to_int, get_dates, get_due_date, is_current, is_after, is_before +from regolith.dates import get_dates, is_current from regolith.fsclient import _id_key -from regolith.sorters import position_key from regolith.tools import ( all_docs_from_collection, - filter_grants, filter_presentations, fuzzy_retrieval, - filter_publications, - get_formatted_crossref_reference, ) @@ -105,7 +100,8 @@ def latex(self): # # if projectum was finished during reporting period or is still current # # some projectum don't have an "end date", but all projecta have a deliverable # # due_date - # if (rp_start_date <= due_date <= rp_end_date and prum['status'] is "finished") or is_current(prum): + # if (rp_start_date <= due_date <= rp_end_date and \ + # prum['status'] is "finished") or is_current(prum): # grant_prums.append(prum) # Get people associated with grant @@ -116,7 +112,7 @@ def latex(self): grant_prum_collaborators = list( set([collab for prum in grant_prums for collab in prum.get("collaborators", [])]) ) - grant_prum_group_members = list( + list( set([grp_mbr for prum in grant_prums for grp_mbr in prum.get("group_members", [])]) ) grant_people = grant_prum_leads @@ -158,14 +154,15 @@ def latex(self): # person = prsn # for education in person['education']: # edu_dates = get_dates(education) - # if 'phd' in education['degree'].lower() and 'columbia' in education['institution'].lower() and \ - # rp_start_date.year <= edu_dates.get('end_date', edu_dates['date']).year <= rp_end_date.year: + # if 'phd' in education['degree'].lower() and 'columbia' in \ + # education['institution'].lower() and rp_start_date.year <= edu_dates.get(\ + # 'end_date', edu_dates['date']).year <= rp_end_date.year: # defended_theses.append(id) # Products # need rg-db-public's citation.yml # publications = filter_publications(self.gtx["citations"], - ## set(grant_people), + # set(grant_people), # since=rp_start_date, # before=rp_end_date) publications = [publ for publ in self.gtx["citations"] if grant_id in publ.get("grant", "")] diff --git a/regolith/builders/preslistbuilder.py b/regolith/builders/preslistbuilder.py index 3821ed8a8..038f1db98 100644 --- a/regolith/builders/preslistbuilder.py +++ b/regolith/builders/preslistbuilder.py @@ -18,22 +18,16 @@ absent both database files, it will still build but using the string name given in the presentations.yml. The presentations are output in a ./_build directory.""" -from copy import deepcopy from regolith.builders.basebuilder import LatexBuilderBase from regolith.fsclient import _id_key from regolith.sorters import position_key from regolith.tools import ( all_docs_from_collection, - fuzzy_retrieval, - get_person_contact, - number_suffix, group_member_ids, - latex_safe, filter_presentations, ) from regolith.stylers import sentencecase, month_fullnames -from regolith.dates import get_dates class PresListBuilder(LatexBuilderBase): diff --git a/regolith/builders/proposalreviewbuilder.py b/regolith/builders/proposalreviewbuilder.py index a1f039ab2..0b862d64d 100644 --- a/regolith/builders/proposalreviewbuilder.py +++ b/regolith/builders/proposalreviewbuilder.py @@ -6,8 +6,6 @@ from regolith.fsclient import _id_key from regolith.tools import ( all_docs_from_collection, - filter_grants, - fuzzy_retrieval, dereference_institution, ) diff --git a/regolith/builders/readinglistsbuilder.py b/regolith/builders/readinglistsbuilder.py index ec7f93106..a9a7c41fa 100644 --- a/regolith/builders/readinglistsbuilder.py +++ b/regolith/builders/readinglistsbuilder.py @@ -23,7 +23,6 @@ def construct_global_ctx(self): gtx = self.gtx rc = self.rc self.cr = Crossref() - cr = self.cr rc.verbose = True gtx["people"] = sorted( all_docs_from_collection(rc.client, "people"), @@ -38,7 +37,6 @@ def construct_global_ctx(self): def latex(self): """Render latex template""" - rc = self.rc # build the collection of formatted references so that we only go # and fetch the formatted references once per doi diff --git a/regolith/dates.py b/regolith/dates.py index 798079e4d..d13533aa3 100644 --- a/regolith/dates.py +++ b/regolith/dates.py @@ -274,14 +274,16 @@ def get_dates(thing, date_field_prefix=None): if not thing.get(datenames[1]): # prefix_month if thing.get("begin_year"): print( - f"WARNING: both year and begin_year specified in {thing.get('_id', '(no id)')}. Year info will be used" + f"WARNING: both year and begin_year specified in {thing.get('_id', '(no id)')}. " + "Year info will be used" ) begin_date = datetime.date(thing[datenames[2]], 1, 1) end_date = datetime.date(thing[datenames[2]], 12, 31) elif not thing.get(datenames[0]): # prfix_day if thing.get("begin_year"): print( - f"WARNING: both year and begin_year specified in {thing.get('_id', '(no id)')}. Year info will be used" + f"WARNING: both year and begin_year specified in {thing.get('_id', '(no id)')}. " + "Year info will be used" ) begin_date = datetime.date(thing[datenames[2]], month_to_int(thing[datenames[1]]), 1) end_date = datetime.date(