Skip to content

Commit

Permalink
Merge pull request #949 from sbillinge/cv_no_editors
Browse files Browse the repository at this point in the history
not_in_cv should be boolean not bool
  • Loading branch information
sbillinge committed Jun 30, 2022
2 parents 589ae19 + 1cb859b commit 232bcdf
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 16 deletions.
13 changes: 13 additions & 0 deletions news/cv_no_editors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**Added:**

* no_in_cv option for employment entries that they don't appear in cv's and resumes

**Changed:** None

**Deprecated:** None

**Removed:** None

**Fixed:** None

**Security:** None
23 changes: 15 additions & 8 deletions regolith/builders/cvbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
filter_employment_for_advisees,
dereference_institution,
merge_collections_superior,
filter_presentations, remove_duplicate_docs,
filter_presentations, remove_duplicate_docs, fuzzy_retrieval,
)


Expand Down Expand Up @@ -48,7 +48,13 @@ def construct_global_ctx(self):
def latex(self):
"""Render latex template"""
rc = self.rc
for p in self.gtx["people"]:
gtx = self.gtx
if rc.people:
people = [fuzzy_retrieval(gtx["people"], ["aka", "_id", "name"], rc.people[0])]
else:
people = gtx["people"]

for p in people:
# so we don't modify the dbs when de-referencing
names = frozenset(p.get("aka", []) + [p["name"]] + [p["_id"]])
begin_period = date(1650, 1, 1)
Expand All @@ -61,11 +67,12 @@ def latex(self):
bibfile = make_bibtex_file(
pubs, pid=p["_id"], person_dir=self.bldir
)
emp = p.get("employment", [])

for e in emp:
emps = p.get("employment", [])
emps = [em for em in emps
if not em.get("not_in_cv", False)]
for e in emps:
e['position'] = e.get('position_full', e.get('position').title())
emp.sort(key=ene_date_key, reverse=True)
emps.sort(key=ene_date_key, reverse=True)
edu = p.get("education", [])
edu.sort(key=ene_date_key, reverse=True)
teach = p.get("teaching", [])
Expand Down Expand Up @@ -96,7 +103,7 @@ def latex(self):
aghs = awards_grants_honors(p, "honors")
service = awards_grants_honors(p, "service", funding=False)
# TODO: pull this out so we can use it everywhere
for ee in [emp, edu]:
for ee in [emps, edu]:
for e in ee:
dereference_institution(e, self.gtx["institutions"])

Expand Down Expand Up @@ -148,7 +155,7 @@ def latex(self):
names=names,
bibfile=bibfile,
education=edu,
employment=emp,
employment=emps,
presentations=presentations,
sentencecase=sentencecase,
monthstyle=month_fullnames,
Expand Down
7 changes: 6 additions & 1 deletion regolith/builders/htmlbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ def people(self):
bibfile = make_bibtex_file(
pubs, pid=p["_id"], person_dir=peeps_dir
)
ene = p.get("employment", []) + p.get("education", [])
emps = p.get("employment", [])
emps = [em for em in emps
if not em.get("not_in_cv", False)]
for e in emps:
e['position'] = e.get('position_full', e.get('position').title())
ene = emps + p.get("education", [])
ene.sort(key=ene_date_key, reverse=True)
for e in ene:
dereference_institution(e,
Expand Down
11 changes: 9 additions & 2 deletions regolith/builders/resumebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
awards_grants_honors,
latex_safe,
make_bibtex_file,
merge_collections_superior,
merge_collections_superior, fuzzy_retrieval,
)


Expand All @@ -38,7 +38,12 @@ def construct_global_ctx(self):
def latex(self):
"""Render latex template"""
rc = self.rc
for p in self.gtx["people"]:
if rc.people:
people = [fuzzy_retrieval(self.gtx["people"], ["aka", "_id", "name"], rc.people[0])]
else:
people = self.gtx["people"]

for p in people:
names = frozenset(p.get("aka", []) + [p["name"]])
pubs = filter_publications(
all_docs_from_collection(rc.client, "citations"),
Expand All @@ -49,6 +54,8 @@ def latex(self):
pubs, pid=p["_id"], person_dir=self.bldir
)
emp = p.get("employment", [])
emp = [em for em in emp
if not em.get("not_in_cv", False)]
for e in emp:
e['position'] = e.get('position_full',
e.get('position').title())
Expand Down
12 changes: 11 additions & 1 deletion regolith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,15 @@
"position_full": "Research Scientist, Postdoctoral Scholar",
"status": "pi"
},
{
"begin_date": "2000-01-01",
"end_date": "2001-12-31",
"location": "Chicago, IL",
"organization": "Google",
"other": [],
"position": "janitor",
"not_in_cv": True
},
],
"funding": [
{
Expand Down Expand Up @@ -3361,8 +3370,9 @@
"type": "string",
"description": "this employment is/was in"
"a group in groups coll",
},
},
"location": {"required": False, "type": "string"},
"not_in_cv": {"required": False, "type": "boolean", "description": "set to true if you want to suppress this entry in all cv's and resumes"},
"organization": {"required": True, "type": "string"},
"other": {"required": False, "type": "list"},
"permanent": {"required": False, "type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion tests/outputs/html/people/sbillinge.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1><a href="#education-and-employment">Education & Employment</a></h1><br/>

<h2>The University of South Carolina</h2>

<h3>assistant professor</h3>
<h3>Assistant Professor</h3>
Columbia, SC, <i>2015 - present</i><br/>

<ul>
Expand Down
6 changes: 3 additions & 3 deletions tests/outputs/html/people/scopatz.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1><a href="#education-and-employment">Education & Employment</a></h1><br/>

<h2>The University of South Carolina</h2>

<h3>assistant professor</h3>
<h3>Assistant Professor, Mechanical Engineering Department</h3>
Columbia, SC, <i>2015 - present</i><br/>

<ul>
Expand All @@ -86,7 +86,7 @@ <h3>ongoing</h3>


<h2>CNERG, The University of Wisconsin-Madison</h2>
<h3>associate scientist</h3>
<h3>Associate Scientist, Engineering Physics Department</h3>

Madison, WI, <i>2013 - 2015</i><br/>

Expand All @@ -101,7 +101,7 @@ <h3>associate scientist</h3>


<h2>The FLASH Center, The University of Chicago</h2>
<h3>post-doctoral scholar</h3>
<h3>Research Scientist, Postdoctoral Scholar</h3>

Chicago, IL, <i>2011 - 2013</i><br/>

Expand Down

0 comments on commit 232bcdf

Please sign in to comment.