pyGenClean.LaTeX package¶
Submodules¶
pyGenClean.LaTeX.auto_report module¶
pyGenClean.LaTeX.merge_reports module¶
-
exception
pyGenClean.LaTeX.merge_reports.
ProgramError
(msg)[source]¶ Bases:
exceptions.Exception
An
Exception
raised in case of a problem.Parameters: msg (str) – the message to print to the user before exiting.
-
pyGenClean.LaTeX.merge_reports.
add_custom_options
(parser)[source]¶ Adds custom options to a parser.
Parameters: parser (argparse.ArgumentParser) – the parser to which to add options.
-
pyGenClean.LaTeX.merge_reports.
checkArgs
(args)[source]¶ Checks the arguments and options.
Parameters: args (argparse.Namespace) – an object containing the options of the program. Returns: True
if everything was OK.If there is a problem with an option, an exception is raised using the
ProgramError
class, a message is printed to thesys.stderr
and the program exists with code 1.
-
pyGenClean.LaTeX.merge_reports.
copy_initial_files
(filename, out_dir)[source]¶ Copy the initial_files file to the final directory.
Parameters: - filename – the name of the file.
- out_dir (str) – the name of the output directory
-
pyGenClean.LaTeX.merge_reports.
generate_report
(out_dir, latex_summaries, nb_markers, nb_samples, options)[source]¶ Generates the report.
Parameters: - out_dir (str) – the output directory.
- latex_summaries (list) – the list of LaTeX summaries.
- nb_markers (str) – the final number of markers.
- nb_samples (str) – the final number of samples.
- options (argparse.Namespace) – the list of options.
-
pyGenClean.LaTeX.merge_reports.
get_final_numbers
(filename, out_dir)[source]¶ Copy the final_files file and get the number of markers and samples.
Parameters: Returns: the final number of markers and samples
Return type:
-
pyGenClean.LaTeX.merge_reports.
get_summary_files
(dirnames)[source]¶ Gets the TeX summary files for each test.
Parameters: dirnames (list) – the list of directories to merge data from. Returns: a list of summary file names. Return type: list
-
pyGenClean.LaTeX.merge_reports.
main
(argString=None)[source]¶ The main function of this module.
Parameters: argString (list of strings) – the options.
-
pyGenClean.LaTeX.merge_reports.
merge_required_files
(dirnames, out_dir)[source]¶ Merges the required files from each of the directories.
Parameters:
-
pyGenClean.LaTeX.merge_reports.
order_qc_dir
(dirnames)[source]¶ Order the QC directory names according to their date.
Parameters: dirnames (list) – the list of directories to merge data from. Returns: the sorted list of directories Return type: list
-
pyGenClean.LaTeX.merge_reports.
parseArgs
(argString=None)[source]¶ Parses the command line options and arguments.
Parameters: argString (list of strings) – the options. Returns: A argparse.Namespace
object created by theargparse
module. It contains the values of the different options.Options Type Description --report-author
String The current project number. --report-number
String The current project author. --report-background
String Text of file containing the background section of the report. Note
No option check is done here (except for the one automatically done by argparse). Those need to be done elsewhere (see
checkArgs()
).
pyGenClean.LaTeX.utils module¶
-
pyGenClean.LaTeX.utils.
bib_entry
(**kwargs)[source]¶ Creates a bibliography entry.
Parameters: Returns: a bib entry.
-
pyGenClean.LaTeX.utils.
format_numbers
(number, prefix='')[source]¶ Formats number in the scientific notation for LaTeX.
Parameters: Returns: a string containing the scientific notation of the number.
Return type:
-
pyGenClean.LaTeX.utils.
item
(text)[source]¶ Returns an LaTeX item (for enumerate or itemize).
Parameters: text (str) – the text. Returns: a LaTeX item.
-
pyGenClean.LaTeX.utils.
sanitize_fig_name
(name)[source]¶ Sanitizes the name of a file (for including graphics in LaTeX).
Parameters: name (str) – the name of the file to sanitize. Returns: the sanitized name. For example, if the name of the graphic file is
test.1.png
, the sanitized version of it for LaTeX is{test.1}.png
.
-
pyGenClean.LaTeX.utils.
sanitize_tex
(original_text)[source]¶ Sanitize TeX text.
Parameters: original_text (str) – the text to sanitize for LaTeX. Returns: the sanitize text. Text is sanitized by following these steps:
- Replaces
\` by ``\textbackslash
- Escapes certain characters (such as
$
,%
,_
,}
,{
,&
and#
) by adding a backslash (e.g. from&
to\&
). - Replaces special characters such as
~
by the LaTeX equivalent (e.g. from~
to$\sim$
).
- Replaces
-
pyGenClean.LaTeX.utils.
section
(name)[source]¶ Creates a new section in LaTeX.
Parameters: name (str) – the name of the new section. Returns: a LaTeX string containing a new section. Return type: str
-
pyGenClean.LaTeX.utils.
subsection
(name)[source]¶ Creates a new section in LaTeX.
Parameters: name (str) – the name of the new section. Returns: a LaTeX string containing a new section. Return type: str
-
pyGenClean.LaTeX.utils.
textbf
(text)[source]¶ Returns bold font.
Parameters: text (str) – the text. Returns: an bold font.
-
pyGenClean.LaTeX.utils.
textit
(text)[source]¶ Returns italic font.
Parameters: text (str) – the text. Returns: an italic font.