diff --git a/news/grantreport.rst b/news/grantreport.rst new file mode 100644 index 000000000..a013bf900 --- /dev/null +++ b/news/grantreport.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Better printing of results from prums in grant report builder + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/regolith/builders/grantreportbuilder.py b/src/regolith/builders/grantreportbuilder.py index c742fa5b5..a790c78ca 100644 --- a/src/regolith/builders/grantreportbuilder.py +++ b/src/regolith/builders/grantreportbuilder.py @@ -90,17 +90,6 @@ def latex(self): for prum in self.gtx["projecta"] if grant_id in prum.get("grants", []) and "checklist" not in prum.get("deliverable").get("scope") ] - # for prum in self.gtx['projecta']: - # if grant_name in prum['grants']: - # begin_date = get_dates(prum).get('begin_date') - # due_date = get_due_date(prum['deliverable']) - # # 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): - # grant_prums.append(prum) - # Get people associated with grant grant_prums_finished_this_period = [ prum for prum in grant_prums if is_current(report_dates, get_dates(prum).get("end_date")) diff --git a/src/regolith/exemplars.json b/src/regolith/exemplars.json index 696c3d066..7edf75d5a 100644 --- a/src/regolith/exemplars.json +++ b/src/regolith/exemplars.json @@ -1704,7 +1704,7 @@ "tasks": ["1saefadf-wdaagea2"], "objective": "lead presents background reading and initial project plan", "audience": ["lead", "pi", "group_members"], - "status": "proposed", + "status": "started", "type": "meeting", "progress": { "text": "The samples have been synthesized and places in the sample cupboard. They turned out well and are blue as expected", diff --git a/src/regolith/templates/grantreport.txt b/src/regolith/templates/grantreport.txt index f555d39c2..43c87d04d 100644 --- a/src/regolith/templates/grantreport.txt +++ b/src/regolith/templates/grantreport.txt @@ -13,21 +13,32 @@ at least one of the 4 categories below)? - Major Activities (currently worked on projecta): {{ hline }} {%- for prum in majorActivities %} - {{ prum.get('_id') }}| {{ prum.get('name') }}| {{prum.get('lead')}} - {{ prum.get('description') }} - {% for milestone in prum.get('milestones') %} - {{ milestone.get("objective") }} - {{ milestone.get("type") }} | {{ milestone.get("status") }} {{ milestone.get("end_date", "") }} - {% endfor -%} -{% endfor -%} - -- Specific Objectives: + Project: {{ prum.get('name') }} + Objective: {{ prum.get('description') }} + Activities: + {%- for milestone in prum.get('milestones') %} + {%- if milestone.get("status") != "proposed" %} + - {{ milestone.get("name") -}}: + Objective: {{ milestone.get("objective") }} + Outcomes: {{ milestone.get("progress").get("text") }} + {%- endif -%} + {%- endfor -%} +{%- endfor %} - Significant Results (finished projecta): {%- for prum in significantResults %} - {{ prum.get('name') }}: {{ prum.get('description') }} -{% endfor -%} + Project: {{ prum.get('name') -}} + Objective: {{ prum.get('description') }} + Activities: + {%- for milestone in prum.get('milestones') %} + {%- if milestone.get("status") != "proposed" %} + - {{ milestone.get("name") -}}: + Objective: {{ milestone.get("objective") }} + Outcomes; {{ milestone.get("progress").get("text") }} + {%- endif -%} + {%- endfor -%} +{%- endfor %} Key outcomes or Other achievements: {{ hline }} @@ -52,13 +63,17 @@ Key outcomes or Other achievements: {{ hline }} * What do you plan to do during the next reporting period to accomplish the goals? {{ hline }} -############################################################# -## ## -## ## -## FILL THIS PART IN !!! FILL THIS PART IN !!! ## -## ## -## ## -############################################################# +{%- for prum in majorActivities %} + Project: {{ prum.get('name') }} + Objective: {{ prum.get('description') }} + Plans: + {%- for milestone in prum.get('milestones') %} + {%- if milestone.get("status") == "proposed" %} + - {{ milestone.get("name") }} + Objective: {{ milestone.get("objective") }} + {%- endif -%} + {%- endfor -%} +{%- endfor %} {{ hline }} Products diff --git a/tests/outputs/a_projectum/projecta.yaml b/tests/outputs/a_projectum/projecta.yaml index 9452521dc..3a4b7201f 100644 --- a/tests/outputs/a_projectum/projecta.yaml +++ b/tests/outputs/a_projectum/projecta.yaml @@ -155,7 +155,7 @@ sb_firstprojectum: - lead - pi - group_members - status: proposed + status: started type: meeting progress: text: The samples have been synthesized and places in the sample cupboard. diff --git a/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt b/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt index fcbb18eac..f79195756 100644 --- a/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt +++ b/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt @@ -12,18 +12,17 @@ at least one of the 4 categories below)? ------------------------------------------------------------------------------ - Major Activities (currently worked on projecta): ------------------------------------------------------------------------------ - sb_firstprojectum| First Projectum| ascopatz - My first projectum - - lead presents background reading and initial project plan - meeting | proposed - - develop a detailed plan with dates - mergedpr | proposed - - Specific Objectives: + Project: First Projectum + Objective: My first projectum + Activities: + - Project lead presentation: + Objective: lead presents background reading and initial project plan + Outcomes: The samples have been synthesized and places in the sample cupboard. They turned out well and are blue as expected -- Significant Results (finished projecta):Key outcomes or Other achievements: +- Significant Results (finished projecta): + +Key outcomes or Other achievements: ------------------------------------------------------------------------------ * What opportunities for training and professional development has the project provided? ------------------------------------------------------------------------------ @@ -38,13 +37,11 @@ at least one of the 4 categories below)? ------------------------------------------------------------------------------ * What do you plan to do during the next reporting period to accomplish the goals? ------------------------------------------------------------------------------ -############################################################# -## ## -## ## -## FILL THIS PART IN !!! FILL THIS PART IN !!! ## -## ## -## ## -############################################################# + Project: First Projectum + Objective: My first projectum + Plans: + - planning meeting + Objective: develop a detailed plan with dates ------------------------------------------------------------------------------ Products diff --git a/tests/outputs/u_logurl/projecta.yaml b/tests/outputs/u_logurl/projecta.yaml index 16f9fdda7..fcc800242 100644 --- a/tests/outputs/u_logurl/projecta.yaml +++ b/tests/outputs/u_logurl/projecta.yaml @@ -157,7 +157,7 @@ sb_firstprojectum: - lead - pi - group_members - status: proposed + status: started type: meeting progress: text: The samples have been synthesized and places in the sample cupboard. diff --git a/tests/outputs/u_milestone/projecta.yaml b/tests/outputs/u_milestone/projecta.yaml index 5291668eb..16b33c45c 100644 --- a/tests/outputs/u_milestone/projecta.yaml +++ b/tests/outputs/u_milestone/projecta.yaml @@ -157,7 +157,7 @@ sb_firstprojectum: - lead - pi - group_members - status: proposed + status: started type: meeting progress: text: The samples have been synthesized and places in the sample cupboard. diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 35f4bfe16..21f74e76f 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -69,21 +69,23 @@ "scopatz, dmref15, 0.0, 75.0, 75.0, 0.0, 0.0\n", ), ( - ["helper", "l_progress", "-l", "ascopatz", "--date", "2022-01-09"], - "\nProgress report for ascopatz, generated 2022-01-09\n" + ["helper", "l_progress", "-l", "pliu", "--date", "2022-01-09"], + "\nProgress report for pliu, generated 2022-01-09\n" "*************************[Orphan Projecta]*************************\n" + "pl_thirdprojectum, status: backburner\n" "*************************[Finished Projecta]*************************\n" + "pl_firstprojectum, grant: None\n" + " description: None\n" + " finished: 2020-07-27\n" "*************************[Proposed Projecta]*************************\n" - "*************************[In Progress Projecta]*************************\n" - "sb_firstprojectum\n" - " status: started, begin_date: 2020-04-28, due_date: 2021-05-05\n" - " description: My first projectum\n" - " log_url: https://docs.google.com/document/d/1YC_wtW5Q\n" + "pl_secondprojectum\n" + " status: proposed, begin_date: 2020-07-25, due_date: 2021-08-26\n" + " description: None\n" + " log_url: None\n" " milestones:\n" - " due: 2020-05-20, Project lead presentation, type: meeting, status: proposed\n" - " objective: lead presents background reading and initial project plan\n" - " due: 2020-05-27, planning meeting, type: mergedpr, status: proposed\n" - " objective: develop a detailed plan with dates\n", + " due: 2021-08-03, Milestone, type: None, status: converged\n" + " objective: None\n" + "*************************[In Progress Projecta]*************************\n", ), ( ["helper", "l_progress", "-l", "pliu", "--date", "2022-01-09"], @@ -120,13 +122,15 @@ " collaborators: aeinstein, pdirac\n" " deliverable:\n" " audience: beginning grad in chemistry\n" - " scope: 1. UCs that are supported or some other scope description if it is software\n" + " scope: 1. UCs that are supported or some other scope description if it " + "is software\n" " 2. sketch of science story if it is paper\n" - " platform: description of how and where the audience will access the deliverable. Journal if it is a paper\n" + " platform: description of how and where the audience will access the " + "deliverable. Journal if it is a paper\n" " milestones:\n" " 2020-05-20: Project lead presentation\n" " objective: lead presents background reading and initial project plan\n" - " status: proposed\n" + " status: started\n" " 2020-05-27: planning meeting\n" " objective: develop a detailed plan with dates\n" " status: proposed\n", @@ -136,14 +140,14 @@ "2021-08-03 (milest): lead: pliu, pl_secondprojectum, status: converged\n Type: \n Title: Milestone\n log url: None\n Purpose: None\n Audience: \n uuid: milestone_uuid_pl2\n" "2021-05-05 (sb_fir): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: \n Title: deliverable\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: deliver\n Audience: beginning grad in chemistry\n Notes:\n - deliverable note\n uuid: sb_firstprojectum\n" "2020-05-27 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: mergedpr\n Title: planning meeting\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: develop a detailed plan with dates\n Audience: ascopatz, scopatz, ascopatz\n uuid: milestone_uuid_sb1_2\n" - "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", + "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: started\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", ), ( ["helper", "l_milestones", "--verbose", "--current"], "2021-08-03 (milest): lead: pliu, pl_secondprojectum, status: converged\n Type: \n Title: Milestone\n log url: None\n Purpose: None\n Audience: \n uuid: milestone_uuid_pl2\n" "2021-05-05 (sb_fir): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: \n Title: deliverable\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: deliver\n Audience: beginning grad in chemistry\n Notes:\n - deliverable note\n uuid: sb_firstprojectum\n" "2020-05-27 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: mergedpr\n Title: planning meeting\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: develop a detailed plan with dates\n Audience: ascopatz, scopatz, ascopatz\n uuid: milestone_uuid_sb1_2\n" - "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", + "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: started\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", ), ( ["helper", "l_milestones", "--verbose", "--current", "--by-prum"], @@ -152,20 +156,20 @@ f"{dash * 50}\n" f"2021-05-05 (sb_fir): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: \n Title: deliverable\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: deliver\n Audience: beginning grad in chemistry\n Notes:\n - deliverable note\n uuid: sb_firstprojectum\n" f"2020-05-27 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: mergedpr\n Title: planning meeting\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: develop a detailed plan with dates\n Audience: ascopatz, scopatz, ascopatz\n uuid: milestone_uuid_sb1_2\n" - f"2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", + f"2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: started\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", ), ( ["helper", "l_milestones", "--verbose", "--all"], "2021-08-26 (pl_fir): lead: pliu, pl_firstprojectum, status: finished\n Type: \n Title: deliverable\n log url: None\n Purpose: deliver\n Audience: \n uuid: pl_firstprojectum\n2021-08-26 (pl_sec): lead: pliu, pl_secondprojectum, status: finished\n Type: \n Title: deliverable\n log url: None\n Purpose: deliver\n Audience: \n uuid: pl_secondprojectum\n2021-08-26 (pl_thi): lead: pliu, pl_thirdprojectum, status: finished\n Type: \n Title: deliverable\n log url: None\n Purpose: deliver\n Audience: \n uuid: pl_thirdprojectum\n2021-08-03 (kopl_f): lead: pliu, pl_firstprojectum, status: backburner\n Type: meeting\n Title: Kickoff\n log url: None\n Purpose: None\n Audience: \n uuid: kopl_firstprojectum\n2021-08-03 (milest): lead: pliu, pl_firstprojectum, status: converged\n Type: \n Title: Milestone\n log url: None\n Purpose: None\n Audience: \n uuid: milestone_uuid_pl1\n2021-08-03 (kopl_s): lead: pliu, pl_secondprojectum, status: backburner\n Type: meeting\n Title: Kickoff\n log url: None\n Purpose: None\n Audience: \n uuid: kopl_secondprojectum\n2021-08-03 (milest): lead: pliu, pl_secondprojectum, status: converged\n Type: \n Title: Milestone\n log url: None\n Purpose: None\n Audience: \n uuid: milestone_uuid_pl2\n2021-08-03 (kopl_t): lead: pliu, pl_thirdprojectum, status: backburner\n Type: meeting\n Title: Kickoff\n log url: None\n Purpose: None\n Audience: \n uuid: kopl_thirdprojectum\n2021-08-03 (milest): lead: pliu, pl_thirdprojectum, status: converged\n Type: \n Title: Milestone\n log url: None\n Purpose: None\n Audience: \n uuid: milestone_uuid_pl3\n2021-05-05 (sb_fir): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: \n Title: deliverable\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: deliver\n Audience: beginning grad in chemistry\n Notes:\n - deliverable note\n uuid: sb_firstprojectum\n2021-05-03 (koab_i): lead: abeing, ab_inactive, status: backburner\n Type: meeting\n Title: Kickoff\n log url: None\n Purpose: None\n Audience: \n uuid: koab_inactive\n2021-05-03 (ab_ina): lead: abeing, ab_inactive, status: paused\n Type: \n Title: deliverable\n log url: None\n Purpose: deliver\n Audience: \n uuid: ab_inactive\n2021-05-03 (milest): lead: abeing, ab_inactive, status: converged\n Type: \n Title: Milestone\n log url: None\n Purpose: None\n Audience: \n uuid: milestone_uuid_inactive\n" "2020-05-27 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: mergedpr\n Title: planning meeting\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: develop a detailed plan with dates\n Audience: ascopatz, scopatz, ascopatz\n uuid: milestone_uuid_sb1_2\n" - "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n" + "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: started\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n" "2020-05-06 (kosb_f): lead: ascopatz, sb_firstprojectum, status: finished\n Type: meeting\n Title: Kick off meeting\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: introduce project to the lead\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - kickoff note\n uuid: kosb_firstprojectum\n", ), ( ["helper", "l_milestones", "--verbose", "--person", "aeinstein"], "2021-05-05 (sb_fir): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: \n Title: deliverable\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: deliver\n Audience: beginning grad in chemistry\n Notes:\n - deliverable note\n uuid: sb_firstprojectum\n" "2020-05-27 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: mergedpr\n Title: planning meeting\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: develop a detailed plan with dates\n Audience: ascopatz, scopatz, ascopatz\n uuid: milestone_uuid_sb1_2\n" - "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", + "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: started\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", ), ( ["helper", "l_milestones", "--verbose", "--stati", "finished"], @@ -179,7 +183,7 @@ ["helper", "l_milestones", "--verbose", "--lead", "ascopatz"], "2021-05-05 (sb_fir): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: \n Title: deliverable\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: deliver\n Audience: beginning grad in chemistry\n Notes:\n - deliverable note\n uuid: sb_firstprojectum\n" "2020-05-27 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: mergedpr\n Title: planning meeting\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: develop a detailed plan with dates\n Audience: ascopatz, scopatz, ascopatz\n uuid: milestone_uuid_sb1_2\n" - "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: proposed\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", + "2020-05-20 (milest): lead: ascopatz, sb_firstprojectum, status: started\n Type: meeting\n Title: Project lead presentation\n log url: https://docs.google.com/document/d/1YC_wtW5Q\n Purpose: lead presents background reading and initial project plan\n Audience: ascopatz, scopatz, ascopatz\n Notes:\n - do background reading\n - understand math\n uuid: milestone_uuid_sb1\n", ), ( ["helper", "l_projecta", "--verbose", "--orphan"],