regolith.builders package

Submodules

regolith.builders.activitylogbuilder module

Builder for CVs.

class regolith.builders.activitylogbuilder.ActivitylogBuilder(rc)[source]

Bases: LatexBuilderBase

Build CV from database entries

btype = 'annual-activity'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['groups', 'people', 'grants', 'proposals', 'institutions', 'projects', 'presentations', 'patents', 'citations', 'proposalReviews', 'refereeReports', 'recletts', 'contacts']

regolith.builders.appraisalbuilder module

Builder for CVs.

class regolith.builders.appraisalbuilder.AppraisalBuilder(rc)[source]

Bases: LatexBuilderBase

Build CV from database entries

btype = 'annual-activity'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['groups', 'people', 'grants', 'proposals', 'institutions', 'projects', 'presentations', 'patents', 'citations']

regolith.builders.basebuilder module

Builder Base Classes

class regolith.builders.basebuilder.BuilderBase(rc)[source]

Bases: object

Base class for builders

build()[source]

Build the thing that is being built, note this runs all commands listed in self.cmds

construct_global_ctx()[source]

Constructs the global context

render(tname, fname, **kwargs)[source]

Render the template into a file using the kwargs and global context

Parameters:
  • tname (str) – Template name

  • fname (str) – Resulting file name

  • kwargs (dict) – Additional kwargs to the renderer

class regolith.builders.basebuilder.LatexBuilderBase(rc)[source]

Bases: BuilderBase

Base class for Latex builders

clean()[source]

Remove files created by latex

construct_global_ctx()[source]

Constructs the global context

pdf(base)[source]

Compiles latex files to PDF

run(cmd)[source]

Run command in build dir

regolith.builders.beamplanbuilder module

Builder for the planning of beamtimes.

The plan contains a summary of the information for the experiments in during a beamtime and details about how to carry out the experiments.

class regolith.builders.beamplanbuilder.BeamPlanBuilder(rc)[source]

Bases: LatexBuilderBase

Build a file of experiment plans for the beamtime from database entries.

The report is in the ‘.tex’ file. The template of the file is in the ‘templates/beamplan.tex’. The data will be grouped according to beamtime. Each beamtime will generate a file of the plans. If ‘beamtime’ in ‘rc’ are not None, only plans for those beamtime will be generated.

construct_global_ctx()[source]

Constructs the global context.

latex()[source]

Render latex template.

btype = 'beamplan'
construct_global_ctx()[source]

Constructs the global context.

latex()[source]

Render latex template.

needed_colls = ['beamplan', 'beamtime']

regolith.builders.coabuilder module

Builder for Recent Collaborators.

For the specified person it returns the name and institution of all graduate student and post-doc advisors, all graduate student advisees, all post-doc advisees in the past 60 monts and all coauthors in the past 48 months.

class regolith.builders.coabuilder.RecentCollaboratorsBuilder(rc)[source]

Bases: BuilderBase

Build recent collaborators from database entries

btype = 'recent-collabs'
construct_global_ctx()[source]

Construct the global ctx including database and methods.

excel()[source]

Query data base and build nsf and doe excels.

static fill_in_tab(ws, ppl, start_row, template_cell_style=None, cols='ABCDE')[source]

Add the information in person, institution pairs into the table 4 in nsf table.

needed_colls = ['citations', 'people', 'contacts', 'institutions']
query_ppl(target)[source]

Query the data base for the target’s collaborators’ information.

render_template1(person_info, collabs, **kwargs)[source]

Render the nsf template.

render_template2(person_info, collabs, **kwargs)[source]

Render the doe template.

regolith.builders.coabuilder.apply_cell_style(*cells, style)[source]

Apply the format to cells.

regolith.builders.coabuilder.copy_cell_style(style_ref_cell)[source]

Copy the cell format to a dictionary.

regolith.builders.coabuilder.filter_since_date(pubs, rc)[source]

Filter the publications after the since_date.

regolith.builders.coabuilder.find_coeditors(person, rc)[source]

Get the coeditors info of the person. Return (last, first, inst, journal).

regolith.builders.coabuilder.find_merged_cell(cells)[source]

Find the index of all merged cells.

regolith.builders.coabuilder.format_last_first_institution_names(rc, ppl_names, excluded_inst_name=None)[source]

Get the last name, first name and institution name.

regolith.builders.coabuilder.format_to_nsf(tups, type_str)[source]

Format the 3 tups to 2 tups. (‘type_str’, ‘last, first’, ‘inst’, …).

regolith.builders.coabuilder.get_advisees_name_inst(coll, advisor, rc)[source]

Get advisor’s advisees. Yield (last name, first name, institutions)

regolith.builders.coabuilder.get_advisors_name_inst(advisee, rc)[source]

Get the advisee’s advisor. Yield (last name, first name, institution name).

regolith.builders.coabuilder.get_coauthors_from_pubs(rc, pubs, not_person)[source]

Get co-authors’ names from the publication. Not include the person itself.

regolith.builders.coabuilder.get_inst_name(person, rc)[source]

Get the name of instituion of the person’s latest employment.

regolith.builders.coabuilder.get_person(person_id, rc)[source]

Get the person’s name.

regolith.builders.coabuilder.get_person_pubs(coll, person)[source]

Get the publications from one person.

regolith.builders.coabuilder.get_recent_org(person_info)[source]

Get the person’s most recent organization.

regolith.builders.coabuilder.get_since_dates(rc)[source]

Get the since_date from command.

regolith.builders.coabuilder.is_merged(cell)[source]

Whether the cell is merged.

regolith.builders.coabuilder.make_person_4tups(person, rc)[source]
regolith.builders.coabuilder.query_people_and_institutions(rc, names)[source]

Get the people and institutions names.

regolith.builders.coabuilder.retrieve_names_and_insts(rc, collabs, not_person_akas=[])[source]
regolith.builders.coabuilder.unmerge(ws, cells)[source]

Unmerge the cells.

regolith.builders.cpbuilder module

Builder for Current and Pending Reports.

class regolith.builders.cpbuilder.CPBuilder(rc)[source]

Bases: LatexBuilderBase

Build current and pending report from database entries

btype = 'current-pending'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['groups', 'people', 'grants', 'proposals']
regolith.builders.cpbuilder.is_declined(status)[source]
regolith.builders.cpbuilder.is_pending(status)[source]

regolith.builders.cvbuilder module

Builder for CVs.

class regolith.builders.cvbuilder.CVBuilder(rc)[source]

Bases: LatexBuilderBase

Build CV from database entries

btype = 'cv'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['institutions', 'people', 'grants', 'citations', 'projects', 'proposals', 'presentations']

regolith.builders.figurebuilder module

Builder for Figure including documents.

class regolith.builders.figurebuilder.FigureBuilder(rc)[source]

Bases: LatexBuilderBase

Build resume from database entries

btype = 'figure'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

regolith.builders.formalletterbuilder module

Builder for publication lists.

class regolith.builders.formalletterbuilder.FormalLetterBuilder(rc)[source]

Bases: LatexBuilderBase

btype = 'formalletter'
construct_global_ctx()[source]

Constructs the global context

latex()[source]
needed_colls = ['formalletters']

regolith.builders.gradebuilder module

Builder for Grade Reports.

class regolith.builders.gradebuilder.GradeReportBuilder(rc)[source]

Bases: LatexBuilderBase

static basename(student_id, course_id)[source]

Returns the base file name for a student in a course.

btype = 'grades'
construct_global_ctx()[source]

Constructs the global context

latex()[source]
makestats(course)[source]

Returns a dictionary of statistics for a course whose keys are the assignments and whose values are a (mean-problem, std-problem, mean-total, std-total) tuple.

maketotals(student_grades, grouped_assignments, course)[source]

Makes total grades.

needed_colls = ['grades', 'courses', 'assignments']
plot_letter_grades(students_kwargs, scale)[source]

Plots the letter grades in a histogram

render(tname, fname, **kwargs)[source]

Render the template into a file using the kwargs and global context

Parameters:
  • tname (str) – Template name

  • fname (str) – Resulting file name

  • kwargs (dict) – Additional kwargs to the renderer

regolith.builders.gradebuilder.find_letter_grade(score, scale=((0.97, 'A+'), (0.93, 'A'), (0.9, 'A-'), (0.87, 'B+'), (0.83, 'B'), (0.8, 'B-'), (0.77, 'C+'), (0.73, 'C'), (0.7, 'C-'), (0.67, 'D+'), (0.63, 'D'), (0.6, 'D-'), (-1.0, 'F')))[source]

Finds the letter grade from a score and a value.

regolith.builders.grantreportbuilder module

Builder for Grant Reports

class regolith.builders.grantreportbuilder.GrantReportBuilder(rc)[source]

Bases: LatexBuilderBase

Build a proposal review from database entries

btype = 'grant-report'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

months_on(grant, person, since=datetime.date(1970, 1, 1), before=datetime.date(2024, 9, 20))[source]
needed_dbs = ['presentations', 'projecta', 'people', 'grants', 'institutions', 'expenses', 'citations', 'contacts']

regolith.builders.htmlbuilder module

Builder for websites.

class regolith.builders.htmlbuilder.HtmlBuilder(rc)[source]

Bases: BuilderBase

Build HTML files for website

abstracts()[source]

Render each abstract

blog()[source]

Render the blog and rss

btype = 'html'
cname()[source]

Add CNAME

construct_global_ctx()[source]

Constructs the global context

finish()[source]

Move files over to their destination and remove them from the source

jobs()[source]

Render the jobs and each job

nojekyll()[source]

Touches a nojekyll file in the build dir

people()[source]

Render people, former members, and each person

projects()[source]

Render projects

root_index()[source]

Render root index

regolith.builders.internalhtmlbuilder module

Builder for websites.

class regolith.builders.internalhtmlbuilder.InternalHtmlBuilder(rc)[source]

Bases: BuilderBase

Build HTML files for website

abstracts()[source]

Render each abstract

blog()[source]

Render the blog and rss

btype = 'internalhtml'
cname()[source]

Add CNAME

construct_global_ctx()[source]

Constructs the global context

finish()[source]

Move files over to their destination and remove them from the source

jobs()[source]

Render the jobs and each job

meetings()[source]

Render projects

needed_colls = ['people', 'meetings']
nojekyll()[source]

Touches a nojekyll file in the build dir

people()[source]

Render people, former members, and each person

projects()[source]

Render projects

root_index()[source]

Render root index

regolith.builders.manuscriptreviewbuilder module

Builder for Current and Pending Reports.

class regolith.builders.manuscriptreviewbuilder.ManRevBuilder(rc)[source]

Bases: LatexBuilderBase

Build a manuscript review from database entries

btype = 'review-man'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['refereeReports']

regolith.builders.postdocadbuilder module

Builder for Current and Pending Reports.

class regolith.builders.postdocadbuilder.PostdocadBuilder(rc)[source]

Bases: LatexBuilderBase

Build current and pending report from database entries

btype = 'postdocads'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['postdocads']

regolith.builders.preslistbuilder module

Builder for Lists of Presentations.

This builder will build a presentation list for each group-member in each group listed in groups.yml. Group members are indicated in the employment and education sections of the individual in people.yml.

There are a number of filtering options, i.e., for presentation-type (invited, colloquium, seminar, poster, contributed_oral) and for whether the invitation was accepted or declined. As of now, these filters can only be updated by editing this file but may appear as command-line options later. It will also get institution and department information from institutions.yml if they are there.

The author list is built from information in people.yml where possible and contacts.yml as a fallback. The author list is built by first performing a fuzzy search for the person in people.yml, followed by a fuzzy search through contacts.yml (if the person was not found in people.yml), but if the person is absent both database files, it will still build but using the string name given in the presentations.yml. The presentations are output in a ./_build directory.

class regolith.builders.preslistbuilder.PresListBuilder(rc)[source]

Bases: LatexBuilderBase

Build list of talks and posters (presentations) from database entries

btype = 'preslist'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['groups', 'institutions', 'people', 'grants', 'presentations', 'contacts']

regolith.builders.proposalreviewbuilder module

Builder for Proposal Reivews.

class regolith.builders.proposalreviewbuilder.PropRevBuilder(rc)[source]

Bases: LatexBuilderBase

Build a proposal review from database entries

btype = 'review-prop'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['institutions', 'proposalReviews']

regolith.builders.publistbuilder module

Builder for publication lists.

class regolith.builders.publistbuilder.PubListBuilder(rc)[source]

Bases: LatexBuilderBase

btype = 'publist'
construct_global_ctx()[source]

Constructs the global context

filter_pubs_by_grant(pubs, grants)[source]
latex()[source]
needed_colls = ['citations', 'people']

regolith.builders.readinglistsbuilder module

Builder for Reading Lists.

class regolith.builders.readinglistsbuilder.ReadingListsBuilder(rc)[source]

Bases: LatexBuilderBase

Build reading lists from database entries

btype = 'readinglists'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['people', 'reading_lists']

regolith.builders.reimbursementbuilder module

Builder for Resumes.

class regolith.builders.reimbursementbuilder.ReimbursementBuilder(rc)[source]

Bases: BuilderBase

Build reimbursement from database entries

btype = 'reimb'
construct_global_ctx()[source]

Constructs the global context

excel()[source]
needed_colls = ['expenses', 'people', 'grants']

regolith.builders.resumebuilder module

Builder for Resumes.

class regolith.builders.resumebuilder.ResumeBuilder(rc)[source]

Bases: LatexBuilderBase

Build resume from database entries

btype = 'resume'
construct_global_ctx()[source]

Constructs the global context

latex()[source]

Render latex template

needed_colls = ['institutions', 'people', 'grants', 'citations', 'projects', 'proposals']