Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Regolith Grant Report Builder #523

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
20 changes: 17 additions & 3 deletions regolith/builders/grantreportbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,21 @@ def latex(self):
begin_year, begin_month, begin_day = int(today[0])-1, int(today[1]), int(today[2])
end_date = date(end_year, end_month, end_day)
begin_date = date(begin_year, begin_month, begin_day)

# Get All Active Members
people = []
for p in self.gtx["people"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current_members = [person for person in self.gtx['people'] if person['active']]

if p["active"]:
people.append(p)

# Major Goals

# Accomplishments

# Opportunities for Training and Professional Development
valid_presentations = []
for p in self.gtx["people"]:
if p["active"] and p["_id"] is not "sbillinge":
for p in people:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for person in people

if p["_id"] is not "sbillinge":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my name shouldn't be hard-coded in here

valid_presentations.append(filter_presentations(
self.gtx["people"], self.gtx["presentations"], self.gtx["institutions"], p["_id"],
["tutorial", "contributed_oral"], begin_date, end_date))
Expand All @@ -70,6 +77,12 @@ def latex(self):

# Plans for Next Reporting Period to Accomplish Goals

# Individuals that have worked on project
individuals_data = []
for p in people:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you keep looping over people so why not put each of these actions inside a single outer loop over people?

individuals_data.append([p["_id"], p["position"]])


self.render(
"grantreport.txt",
"billinge_grant_report.txt",
Expand All @@ -79,5 +92,6 @@ def latex(self):
beginYear=begin_year,
beginMonth=begin_month,
beginDay=begin_day,
presentations=valid_presentations
presentations=valid_presentations,
individuals=individuals_data
)
5 changes: 4 additions & 1 deletion regolith/templates/grantreport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ at least one of the 4 categories below)?
Major Activities:
Specific Objectives:
Significant Results:
Key outcomes or Other achievements:

Key outcomes or Other achievements:
* What opportunities for training and professional development has the project provided?
{%- for opportunity in presentations %}
- {{opportunity -}}
{% endfor -%}}

* How have the results been disseminated to communities of interest?

Expand Down
2 changes: 1 addition & 1 deletion tests/outputs/grantreport/billinge_grant_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ at least one of the 4 categories below)?
Major Activities:
Specific Objectives:
Significant Results:
Key outcomes or Other achievements:

Key outcomes or Other achievements:
* What opportunities for training and professional development has the project provided?

* How have the results been disseminated to communities of interest?
Expand Down