Skip to content

Commit

Permalink
feat: cv and resume now differentiate current and past projects (#1228)
Browse files Browse the repository at this point in the history
* feat: cv and resume now differentiate current and past projects

* news

* fix: reinstate TEMPLATE.rst

* prettier news
  • Loading branch information
sbillinge authored Jan 14, 2025
1 parent c0d1791 commit cc7c5a0
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 17 deletions.
23 changes: 23 additions & 0 deletions news/current-projects.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* CV and resume now differentiates current and past projects.

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
7 changes: 5 additions & 2 deletions src/regolith/builders/cvbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def latex(self):
for t in teach:
t["position"] = t.get("position").title()

projs = filter_projects(all_docs_from_collection(rc.client, "projects"), names)
current_projects = filter_projects(all_docs_from_collection(rc.client, "projects"), names, active=True)
past_projects = filter_projects(all_docs_from_collection(rc.client, "projects"), names, active=False)
projs = current_projects + past_projects
for proj in projs:
for member in proj.get("team", []):
member.get("role", "").replace("pi", "PI")
Expand Down Expand Up @@ -168,7 +170,8 @@ def latex(self):
presentations=presentations,
sentencecase=sentencecase,
monthstyle=month_fullnames,
projects=projs,
current_projects=current_projects,
past_projects=past_projects,
pi_grants=pi_grants,
pi_amount=pi_amount,
coi_grants=coi_grants,
Expand Down
6 changes: 4 additions & 2 deletions src/regolith/builders/resumebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def latex(self):
emp.sort(key=ene_date_key, reverse=True)
edu = p.get("education", [])
edu.sort(key=ene_date_key, reverse=True)
projs = filter_projects(all_docs_from_collection(rc.client, "projects"), names)
current_projects = filter_projects(all_docs_from_collection(rc.client, "projects"), names, active=True)
past_projects = filter_projects(all_docs_from_collection(rc.client, "projects"), names, active=False)
grants = list(all_docs_from_collection(rc.client, "grants"))
proposals = list(all_docs_from_collection(rc.client, "proposals"))
grants = merge_collections_superior(proposals, grants, "proposal_id")
Expand All @@ -77,7 +78,8 @@ def latex(self):
bibfile=bibfile,
education=edu,
employment=emp,
projects=projs,
current_projects=current_projects,
past_projects=past_projects,
pi_grants=pi_grants,
pi_amount=pi_amount,
coi_grants=coi_grants,
Expand Down
1 change: 1 addition & 0 deletions src/regolith/exemplars.json
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,7 @@
"projects": {
"_id": "Cyclus",
"name": "Cyclus",
"active": true,
"description": "Agent-Based Nuclear Fuel Cycle Simulator",
"group": "ergs",
"highlights": [
Expand Down
30 changes: 27 additions & 3 deletions src/regolith/templates/cv.tex
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,35 @@ \subsection*{Research Focus Areas}
\end{itemize}
{% endif %}

{% if len(projects) > 0 %}
{% if len(current_projects) > 0 %}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Projects}
\resheading{Current Projects}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{% for proj in projects %}
{% for proj in current_projects %}
{% set me = proj['team'][0] %}
\ressubheadingitemslongtitle{ {{-proj['name']-}} }
{ {{-me['position']-}} }
{ {{-proj['description']-}} }
{ {{-month_and_year(me.get('begin_month'), me.get('begin_year'))}} -
{{month_and_year(me.get('end_month'), me.get('end_year'))-}} }
{
{% for o in proj['other'] %}
\resitem{ {{-latex_safe(o)-}} }
{% endfor %}
{% if proj['website'] and len(proj['website']) > 0 %}
\resitem{Website: \url{ {{-latex_safe(proj['website'], url_check=False)-}} } }
{% endif %}
}
\vspace{0.5em}
{% endfor %}
{% endif %}


{% if len(past_projects) > 0 %}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Past Projects}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{% for proj in past_projects %}
{% set me = proj['team'][0] %}
\ressubheadingitemslongtitle{ {{-proj['name']-}} }
{ {{-me['position']-}} }
Expand Down
29 changes: 26 additions & 3 deletions src/regolith/templates/resume.tex
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,34 @@
\end{center}\vspace*{-16pt}
{% endif %}

{% if len(projects) > 0 %}
{% if len(current_projects) > 0 %}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Projects}
\resheading{Current Projects}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{% for proj in projects %}
{% for proj in current_projects %}
{% set me = proj['team'][0] %}
\ressubheadingitemslongtitle{ {{-proj['name']-}} }
{ {{-me['position']-}} }
{ {{-proj['description']-}} }
{ {{-month_and_year(me.get('begin_month'), me.get('begin_year'))}} -
{{month_and_year(me.get('end_month'), me.get('end_year'))-}} }
{
{% for o in proj['other'] %}
\resitem{ {{-latex_safe(o)-}} }
{% endfor %}
{% if proj['website'] and len(proj['website']) > 0 %}
\resitem{Website: \url{ {{-latex_safe(proj['website'], url_check=False)-}} } }
{% endif %}
}
\vspace{0.5em}
{% endfor %}
{% endif %}

{% if len(past_projects) > 0 %}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Past Projects}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{% for proj in past_projects %}
{% set me = proj['team'][0] %}
\ressubheadingitemslongtitle{ {{-proj['name']-}} }
{ {{-me['position']-}} }
Expand Down
14 changes: 9 additions & 5 deletions src/regolith/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def filter_publications(
return pubs


def filter_projects(projects, people, reverse=False, active_only=False, group=None, ptype=None):
def filter_projects(projects, people, reverse=False, active=True, group=None, ptype=None):
"""Filter projects by the author(s)
Parameters
Expand All @@ -243,9 +243,10 @@ def filter_projects(projects, people, reverse=False, active_only=False, group=No
before : date, optional
The date before which a highlight must be for a project to be returned,
defaults to None
active_only : bool, optional
Only active projects will be returned if True,
defaults to False
active : bool, optional
Only active projects will be returned if True. Only non-active projects
will be returned if False. Run twice with trae and false to get all
projects. defaults to True
group : str, optional
Only projects from this group will be returned if specified, otherwise
projects from all groups will be returned, defaults to None
Expand All @@ -259,9 +260,12 @@ def filter_projects(projects, people, reverse=False, active_only=False, group=No
team_names = set(gets(proj["team"], "name"))
if len(team_names & people) == 0:
continue
if active_only:
if active:
if not proj.get("active"):
continue
else:
if proj.get("active"):
continue
if group:
if proj.get("group") != group:
continue
Expand Down
2 changes: 1 addition & 1 deletion tests/outputs/cv/scopatz.tex
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ \subsection*{Research Focus Areas}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Projects}
\resheading{Current Projects}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Expand Down
2 changes: 1 addition & 1 deletion tests/outputs/resume/scopatz.tex
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Projects}
\resheading{Current Projects}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Expand Down

0 comments on commit cc7c5a0

Please sign in to comment.