Skip to content

Commit

Permalink
changed test to show how I want the grant-report to look (#1234)
Browse files Browse the repository at this point in the history
* changed test to show how I want the grant-report to look

but code not yet updated to do it!

* new grant reports passing tests locally

* news

* fix: now passing helper tests
  • Loading branch information
sbillinge authored Jan 21, 2025
1 parent 41be82a commit 9ba36ae
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 70 deletions.
23 changes: 23 additions & 0 deletions news/grantreport.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Better printing of results from prums in grant report builder

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
11 changes: 0 additions & 11 deletions src/regolith/builders/grantreportbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion src/regolith/exemplars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
51 changes: 33 additions & 18 deletions src/regolith/templates/grantreport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/outputs/a_projectum/projecta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?
------------------------------------------------------------------------------
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/outputs/u_logurl/projecta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/outputs/u_milestone/projecta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 9ba36ae

Please sign in to comment.