-
Notifications
You must be signed in to change notification settings - Fork 55
Add LaTeX output format support #183
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -187,6 +187,31 @@ def render(self): | |||||
|
|
||||||
| return JsonDict(blank_jupyter_notebook) | ||||||
|
|
||||||
| class Latex(Format): | ||||||
| doc_template = r""" | ||||||
| \documentclass{article} | ||||||
| \begin{document} | ||||||
| {content} | ||||||
| \end{document} | ||||||
| """ | ||||||
|
|
||||||
| template = r""" | ||||||
| \section*{{{title}}} | ||||||
| {sections} | ||||||
| """ | ||||||
|
Comment on lines
+198
to
+201
|
||||||
|
|
||||||
| section_template = r""" | ||||||
| \subsection*{{{title}}} | ||||||
| \begin{itemize} | ||||||
| {lines} | ||||||
| \end{itemize} | ||||||
| """ | ||||||
|
|
||||||
| line_template = r"\item {line}" | ||||||
|
||||||
| line_template = r"\item {line}" | |
| line_template = r"\item \textbf{{{line_id} {line_summary}}}: {line}" |
Copilot
AI
Feb 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the established testing pattern in this codebase, the Latex format should have corresponding test functions in tests/test_formats.py and a known_good_latex example in tests/assets.py. See test_markdown, test_rst, and test_html for reference implementations. Tests should verify render() output matches the known_good example and test write() behavior with new/existing files.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
|
|
||
| \section*{Data Science Ethics Checklist} | ||
|
|
||
| \subsection*{A. Data Collection} | ||
| \begin{itemize} | ||
| \item If there are human subjects, have they given informed consent, where subjects affirmatively opt-in and have a clear understanding of the data uses to which they consent? | ||
| \item Have we considered sources of bias that could be introduced during data collection and survey design and taken steps to mitigate those? | ||
| \item Have we considered ways to minimize exposure of personally identifiable information (PII) for example through anonymization or not collecting information that isn't relevant for analysis? | ||
| \item Have we considered ways to enable testing downstream results for biased outcomes (e.g., collecting data on protected group status like race or gender)? | ||
| \end{itemize} | ||
|
|
||
|
|
||
|
|
||
| \subsection*{B. Data Storage} | ||
| \begin{itemize} | ||
| \item Do we have a plan to protect and secure data (e.g., encryption at rest and in transit, access controls on internal users and third parties, access logs, and up-to-date software)? | ||
| \item Do we have a mechanism through which an individual can request their personal information be removed? | ||
| \item Is there a schedule or plan to delete the data after it is no longer needed? | ||
| \end{itemize} | ||
|
|
||
|
|
||
|
|
||
| \subsection*{C. Analysis} | ||
| \begin{itemize} | ||
| \item Have we sought to address blindspots in the analysis through engagement with relevant stakeholders (e.g., checking assumptions and discussing implications with affected communities and subject matter experts)? | ||
| \item Have we examined the data for possible sources of bias and taken steps to mitigate or address these biases (e.g., stereotype perpetuation, confirmation bias, imbalanced classes, or omitted confounding variables)? | ||
| \item Are our visualizations, summary statistics, and reports designed to honestly represent the underlying data? | ||
| \item Have we ensured that data with PII are not used or displayed unless necessary for the analysis? | ||
| \item Is the process of generating the analysis well documented and reproducible if we discover issues in the future? | ||
| \end{itemize} | ||
|
|
||
|
|
||
|
|
||
| \subsection*{D. Modeling} | ||
| \begin{itemize} | ||
| \item Have we ensured that the model does not rely on variables or proxies for variables that are unfairly discriminatory? | ||
| \item Have we tested model results for fairness with respect to different affected groups (e.g., tested for disparate error rates)? | ||
| \item Have we considered the effects of optimizing for our defined metrics and considered additional metrics? | ||
| \item Can we explain in understandable terms a decision the model made in cases where a justification is needed? | ||
| \item Have we communicated the shortcomings, limitations, and biases of the model to relevant stakeholders in ways that can be generally understood? | ||
| \end{itemize} | ||
|
|
||
|
|
||
|
|
||
| \subsection*{E. Deployment} | ||
| \begin{itemize} | ||
| \item Do we have a clear plan to monitor the model and its impacts after it is deployed (e.g., performance monitoring, regular audit of sample predictions, human review of high-stakes decisions, reviewing downstream impacts of errors or low-confidence decisions, testing for concept drift)? | ||
| \item Have we discussed with our organization a plan for response if users are harmed by the results (e.g., how does the data science team evaluate these cases and update analysis and models to prevent future harm)? | ||
| \item Is there a way to turn off or roll back the model in production if necessary? | ||
| \item Have we taken steps to identify and prevent unintended uses and abuse of the model and do we have a plan to monitor these once the model is deployed? | ||
| \end{itemize} | ||
|
|
||
|
Comment on lines
+1
to
+52
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LaTeX output is missing the docs_link footer that is included in other formats (see examples/ethics.txt line 34, examples/ethics.md line 36). This inconsistency occurs because the template doesn't include a {docs_link} placeholder. Consider adding it at the end of the template or hardcoding it like the HTML format does.