Skip to content

Commit

Permalink
Merge pull request #1048 from sbillinge/clean_c+p
Browse files Browse the repository at this point in the history
clean c+p
  • Loading branch information
sbillinge authored Nov 5, 2023
2 parents 05a000b + 66ffd5e commit 1471ed7
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 47 deletions.
23 changes: 23 additions & 0 deletions news/clean_c+p.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* additional tests for c+p, annual-activity and grant-report builders

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
12 changes: 8 additions & 4 deletions regolith/builders/cpbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ def latex(self):
dict(g)
for g in grants
if is_current(g)
and not is_pending(g.get("status", "None"))
and not is_declined(g.get("status", "None"))
]
current_grants, _, _ = filter_grants(
current_grants, {pi["name"]}, pi=False, multi_pi=True
)
current_grants = [g for g in current_grants if
g.get("status") != "declined"]
for g in current_grants:
if g.get('budget'):
amounts = [i.get('amount') for i in g.get('budget')]
g['subaward_amount'] = sum(amounts)

pending_grants = [
g for g in grants
if is_pending(g.get("status", ""))
if is_pending(g.get("status", "None"))
]
for g in pending_grants:
for person in g["team"]:
Expand All @@ -126,7 +126,11 @@ def latex(self):
),
)
badids = [i["_id"] for i in current_grants if
not i.get('cpp_info').get('cppflag', "")]
not i.get('cpp_info',{}).get('cppflag', "")]
# badids_pending = ([i["_id"] for i in pending_grants if
# not i.get('cpp_info',{}).get('cppflag', "")])
if badids:
print(f"these grants have a problem with ccp_info: {*badids,}")

iter = copy(current_grants)
for grant in iter:
Expand Down
4 changes: 2 additions & 2 deletions regolith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@
"position": "researcher",
},
],
"status": "pending",
"title": "SymPy 1.1 Release Support",
"status": "accepted",
"title": "SymPy 2.0 Release Support",
"budget": [
{"begin_date": "2019-06-01",
"end_date": "2024-12-31",
Expand Down
12 changes: 6 additions & 6 deletions regolith/templates/current_pending.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
\vskip 12pt\noindent
\textbf{Investigator:} {{ latex_safe(pi['name']) }}\
\textbf{Other Agencies to which proposal submitted:}
{{ latex_safe(g.get('cpp_info').get("other_agencies_submitted", 'None')) }}
{{ latex_safe(g.get('cpp_info',{}).get("other_agencies_submitted", 'None')) }}

\textbf{Support:}\ {{ name }}

\textbf{Project/Proposal Title:} {{ latex_safe(g['title'])-}}
{% if not g.get('cpp_info').get('single_pi') %}
{% if not g.get('cpp_info',{}).get('single_pi') %}
\ (multi-PI grant. {{latex_safe(pi['initials'])}}
amt = \${{"{:,}".format(float(g['subaward_amount']))}})
{% endif %}
Expand All @@ -44,14 +44,14 @@
\textbf{ Total Award Period Covered:}
{{g.get('award_start_date')}} - {{g.get('award_end_date')}}

\textbf{Location of Project:} {{ g.get('cpp_info').get('institution', group.get('institution')) }}
\textbf{Location of Project:} {{ g.get('cpp_info',{}).get('institution', group.get('institution')) }}

\textbf{Person Months per Year Committed to Project:}
\textbf{Academic:} {{ str(g.get('cpp_info').get('person_months_academic', 0)) }}\
\textbf{Summer:} {{ str(g.get('cpp_info').get('person_months_summer', 0)) }}
\textbf{Academic:} {{ str(g.get('cpp_info',{}).get('person_months_academic', 0)) }}\
\textbf{Summer:} {{ str(g.get('cpp_info',{}).get('person_months_summer', 0)) }}

\textbf{Describe Research Including Synergies and Delineation with
Respect to this Proposal/Award:} {{ g.get('cpp_info').get('project_scope', 'N/A')-}}
Respect to this Proposal/Award:} {{ g.get('cpp_info',{}).get('project_scope', 'N/A')-}}
{% endfor %}
{% endif %}
\vskip 14pt
Expand Down
33 changes: 2 additions & 31 deletions tests/outputs/current-pending/current-pending-ergs-scopatz.tex
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,6 @@
\textbf{Describe Research Including Synergies and Delineation with
Respect to this Proposal/Award:}

\vskip 12pt\noindent
\textbf{Investigator:} Anthony Scopatz\
\textbf{Other Agencies to which proposal submitted:}
None

\textbf{Support:}\ Pending

\textbf{Project/Proposal Title:} SymPy 1.1 Release Support
\ (multi-PI grant. AS
amt = \$0.0)

\textbf{Source of Support:}\
NumFOCUS

\textbf{Total Award Amount}:
\$3,000.0\\

\textbf{ Total Award Period Covered:}
6/1/2019 - 12/31/2030

\textbf{Location of Project:} Columbia University

\textbf{Person Months per Year Committed to Project:}
\textbf{Academic:} 0\
\textbf{Summer:} 1

\textbf{Describe Research Including Synergies and Delineation with
Respect to this Proposal/Award:}

\vskip 14pt


Expand All @@ -89,7 +60,7 @@

\textbf{Support:}\ Current

\textbf{Project/Proposal Title:} SymPy 1.1 Release Support
\textbf{Project/Proposal Title:} SymPy 2.0 Release Support
\ (multi-PI grant. AS
amt = \$3,000.0)

Expand All @@ -116,4 +87,4 @@



\end{document}
\end{document}
4 changes: 2 additions & 2 deletions tests/outputs/cv/scopatz.tex
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ \subsection*{Research Focus Areas}

}

\ressubheadingitemslongtitle{SymPy 1.1 Release Support}
\ressubheadingitemslongtitle{SymPy 2.0 Release Support}
{ \$3,000.00}
{NumFOCUS Small Development Grants }
{Jun 2019 -
Expand Down Expand Up @@ -535,4 +535,4 @@ \subsection*{ Current Ph.D. students }

\end{itemize}

\end{document}
\end{document}
4 changes: 2 additions & 2 deletions tests/outputs/resume/scopatz.tex
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@

}

\ressubheadingitemslongtitle{SymPy 1.1 Release Support}
\ressubheadingitemslongtitle{SymPy 2.0 Release Support}
{ \$3,000.00}
{NumFOCUS Small Development Grants }
{Jun 2019 -
Expand Down Expand Up @@ -369,4 +369,4 @@

\end{itemize}

\end{document}
\end{document}

0 comments on commit 1471ed7

Please sign in to comment.