def latex(self): """Render latex template""" for rev in self.gtx["refereeReports"]: outname = "{}_{}".format(_id_key(rev), rev["reviewer"]) self.render("refreport_author.txt", outname + "_author.txt", trim_blocks=True, title=rev["title"], firstAuthorLastName=rev["first_author_last_name"], journal=rev["journal"], didWhat=rev["did_what"], didHow=rev["did_how"], foundWhat=rev["claimed_found_what"], whyImportant=rev["claimed_why_important"], validityAssessment=rev["validity_assessment"], finalAssessment=rev["final_assessment"], recommendation=rev["recommendation"], freewrite=rev["freewrite"]) if len(rev["editor_eyes_only"]) > 0: self.render( "refreport_editor.txt", outname + "_editor.txt", title=rev["title"], firstAuthorLastName=rev["first_author_last_name"], editorEyesOnly=rev["editor_eyes_only"], )
def latex(self): """Render latex template""" for rev in self.gtx["proposalReviews"]: outname = "{}_{}".format(_id_key(rev), rev["reviewer"]) multiauth = False if isinstance(rev["names"], str): rev["names"] = [rev["names"]] if len(rev["names"]) > 1: multiauth = True firstauthor = HumanName(rev["names"][0]) firstauthorlastname = firstauthor.last if isinstance(rev.get("institutions", ""), str): rev["institutions"] = [rev.get("institutions", "")] if len(rev["institutions"]) == 0: rev["institutions"] = [""] institution_docs = [] for inst in rev["institutions"]: instdoc = {"institution": inst} dereference_institution(instdoc, self.gtx["institutions"]) if not instdoc: instdoc = {"institution": inst} institution_docs.append(instdoc) if isinstance(rev["freewrite"], str): rev["freewrite"] = [rev["freewrite"]] self.render( "propreport.txt", "{}.txt".format(outname), trim_blocks=True, agency=rev["agency"], appropriateness=rev["doe_appropriateness_of_approach"], title=rev["title"], institution=institution_docs[0].get("institution"), multiauthor=multiauth, firstAuthorLastName=firstauthorlastname, competency=rev["competency_of_team"], adequacy=rev["adequacy_of_resources"], does_what=rev["does_what"], relevance=rev["doe_relevance_to_program_mission"], budget=rev["doe_reasonableness_of_budget"], does_how=rev["does_how"], goals=rev["goals"], importance=rev["importance"], summary=rev["summary"], freewrite=rev["freewrite"], broader_impacts=rev["nsf_broader_impacts"], creativity_originality=rev["nsf_create_original_transformative"], benefit_to_society=rev["nsf_pot_to_benefit_society"], plan_good=rev["nsf_plan_good"], advance_knowledge=rev["nsf_pot_to_advance_knowledge"] )