stepup.reprep.api¶
Application programming interface for StepUp RepRep.
add_notes_pdf(path_src, path_notes, path_dst, optional=False, block=False)
¶
Add a notes page at every even page of a PDF file.
Parameters:
-
path_src(str) –The original PDF document without notes pages.
-
path_notes(str) –A single-page PDF document with a page suitable for taking notes.
-
path_dst(str) –The output PDF with notes pages inserted.
-
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
cat_pdf(paths_inp, path_out, *, insert_blank=False, optional=False, block=False)
¶
Concatenate the pages of multiple PDFs into one document
Parameters:
-
paths_inp(Collection[str]) –The input PDF files.
-
path_out(str) –The concatenated PDF.
-
insert_blank(bool, default:False) –Insert a blank page after a PDF with an odd number of pages. The last page of each PDF is used to determine the size of the added blank page.
-
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
check_hrefs(path_src, path_config=None, block=False)
¶
Check hyper references in a Markdown, HTML or PDF file.
Parameters:
-
path_src(str) –The source Markdown, HTML or PDF to check.
-
path_config(str | None, default:None) –The configuration file. Defaults to
${REPREP_CHECK_HREFS_CONFIG}variable orcheck_hrefs.yamlif it is not set. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
compile_latex(path_tex, *, run_bibtex=True, maxrep=5, workdir='./', latex=None, bibtex=None, inventory=None, optional=False, block=False)
¶
Create a step for the compilation of a LaTeX source.
Parameters:
-
path_tex(str) –The main tex source file. This argument may contain environment variables.
-
run_bibtex–By default, when bib files are used, BibTeX is invoked. This can be overruled by setting this argument to False, which is useful when recompiling sources with fixed bbl files.
-
maxrep(int, default:5) –The maximum number of repetitions of the LaTeX command in case the aux file keeps changing.
-
workdir(str, default:'./') –The working directory where the LaTeX command must be executed.
-
latex(str | None, default:None) –Path to the LaTeX executable. Note that only PDF-producing LaTeX compilers are supported:
pdflatex,xelatexorlualatex. Defaults to${REPREP_LATEX}variable orpdflatexif the variable is unset. -
bibtex(str | None, default:None) –Path to the BibTeX executable. Defaults to
${REPREP_BIBTEX}variable orbibtexif the variable is unset. -
inventory(str | bool | None, default:None) –If set to a
str, it specifies the inventory file to write. If set toTrue, the inventory file is written to the default location, which is the stem of the source file with-inventory.txtappended. When the environment variableREPREP_LATEX_INVENTORYis set to1, the inventory file is always written, unless this argument is set toFalse. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Notes
The LaTeX source is compiled with the rr-compile-latex command,
which can detect dependencies on other files by scanning for
\input, \include, \includegraphics, etc.
Due to the complexity of LaTeX, the dependency scanning is not perfect.
You can manually specify dependencies in the LaTeX source with the following comments:
%REPREP inp inp_path%REPREP out out_path%REPREP vol vol_path
When any of these paths is a relative path,
it is interpreted in the same way as the LaTeX compiler would resolve it.
You can also hide lines from the dependency scanner by adding %REPREP ignore
at the end of a line.
Source code in stepup/reprep/api.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
compile_tectonic(path_tex, dest=None, *, workdir='./', tectonic=None, keep_deps=False, tectonic_args=(), inventory=None, optional=False, block=False)
¶
Create a step for the compilation of a LaTeX source with Tectonic.
Warning
This feature is only tested with Tectonic 0.15
Support for Tectonic in StepUp RepRep is experimental. Expect breaking changes in future releases.
Parameters:
-
path_tex(str) –The main LaTeX source file. This argument may contain environment variables.
-
dest(str | None, default:None) –Output destination:
None, a directory or a file. -
workdir(str, default:'./') –The working directory where the LaTeX command must be executed.
-
tectonic(str | None, default:None) –Path to the Tectonic executable. Defaults to
${REPREP_TECTONIC}variable ortectonicif the variable is unset. -
keep_deps(bool, default:False) –If
True, the dependency file is kept after the compilation. The dependency file is also kept if the environment variableREPREP_KEEP_TECTONIC_DEPSis set to"1". -
tectonic_args(Collection[str], default:()) –Additional arguments for tectonic. The defaults is
${REPREP_TECTONIC_ARGS}, if the environment variable is defined. -
inventory(str | bool | None, default:None) –If set to a
str, it specifies the inventory file to write. If set toTrue, the inventory file is written to the default location, which is the stem of the source file with-inventory.txtappended. When the environment variableREPREP_TECTONIC_INVENTORYis set to1, the inventory file is always written, unless this argument is set toFalse. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | |
compile_typst(path_typ, dest=None, *, sysinp=None, resolution=None, workdir='./', typst=None, keep_deps=False, typst_args=(), inventory=None, optional=False, block=False)
¶
Create a step for the compilation of a Typst source.
Warning
This feature will only work well with Typst 0.14 or later.
Support for Typst in StepUp RepRep is experimental. Expect breaking changes in future releases. Some limitations include:
- SVG figures with references to external SVG images are not processed correctly. These images are not rendered, neither are they included in the dep file. This currently being addressed in the following issue: https://github.com/typst/typst/issues/6858
- When the typst compiler detects an error in the input, it doesn’t write the dep file. While this is the desirable behavior for Make-like tools, it does not work well in StepUp. This issue is fixed in the main branch of typst, but not yet in a released version: https://github.com/typst/typst/pull/7209 After the next release of Typst, StepUp RepRep will be updated to use of JSON dep files: https://github.com/reproducible-reporting/stepup-reprep/pull/22
Parameters:
-
path_typ(str) –The main typst source file. This argument may contain environment variables.
-
dest(str | None, default:None) –Output destination:
None, a directory or a file. For SVG and PNG outputs, this argument must be specified with the desired extension. If the output contains any of{p},{0p}or{t}, the output paths are not known a priori and will be amended. -
sysinp(dict[str, str | Path] | None, default:None) –A dictionary with the input arguments passed to
typstwith--input key=val. Items are ignored when keys are not strings or when values are not of typestr,int,floatorPath. If a key is not a valid Python identifier, an exception is raised. When values arePathinstances, they are treated as input dependencies for the step. These parameters are available in the document as#sys.inputs.key. One may also provide an object, which is converted into adictwith thevars()built-in. -
resolution(int | None, default:None) –The resolution of the bitmap in dots per inch (dpi), only relevant for PNG output.
-
workdir(str, default:'./') –The working directory where the LaTeX command must be executed.
-
typst(str | None, default:None) –Path to the Typst executable. Defaults to
${REPREP_TYPST}variable ortypstif the variable is unset. -
keep_deps(bool, default:False) –If
True, the dependency file is kept after the compilation. The dependency file is also kept if the environment variableREPREP_KEEP_TYPST_DEPSis set to"1". -
typst_args(Collection[str], default:()) –Additional arguments for typst. The defaults is
${REPREP_TYPST_ARGS}, if the environment variable is defined. -
inventory(str | bool | None, default:None) –If set to a
str, it specifies the inventory file to write. If set toTrue, the inventory file is written to the default location, which is the stem of the source file with-inventory.txtappended. When the environment variableREPREP_TYPST_INVENTORYis set to1, the inventory file is always written, unless this argument is set toFalse. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | |
convert_inkscape(path_svg, path_out, *, inkscape=None, inkscape_args=(), optional=False, block=False)
¶
Convert an SVG figure to a PDF file, detecting dependencies of the SVG on other files.
Parameters:
-
path_svg(str) –The input SVG figure. It may contain
tags referring to other files included in the figure.
-
path_out(str) –The output PDF or PNG file. Other formats are not supported.
-
inkscape(str | None, default:None) –The path to the inkscape executable. Defaults to
${REPREP_INKSCAPE}variable orinkscapeif the variable is unset. -
inkscape_args(Collection[str], default:()) –Additional arguments to pass to inkscape. E.g.
["-T"]to convert text to glyphs in PDFs. Depending on the extension of the output, the default is${REPREP_INKSCAPE_PDF_ARGS}or${REPREP_INKSCAPE_PNG_ARGS}, if the environment variable is defined. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Notes
A wrapper around inkscape is used to carry out the conversion: stepup.reprep.convert_inkscape.
The wrapper scans the SVG for dependencies, which may be a bit slow in case of large files.
Source code in stepup/reprep/api.py
convert_inkscape_pdf(path_svg, dest=None, *, inkscape=None, inkscape_args=(), optional=False, block=False)
¶
Shorthand for convert_inkscape with the output file derived from the SVG file.
The dest argument can be None, a directory or a file.
Source code in stepup/reprep/api.py
convert_inkscape_png(path_svg, dest=None, *, inkscape=None, inkscape_args=(), optional=False, block=False)
¶
Shorthand for convert_inkscape with the output file derived from the SVG file.
The dest argument can be None, a directory or a file. See make_path_out.
Source code in stepup/reprep/api.py
convert_jupyter(path_nb, dest=None, *, inp=(), out=(), execute=True, to=None, nbargs=None, jupyter=None, optional=False, pool=None, block=False)
¶
Convert a Jupyter notebook, by default to HTML with execution of cells.
Warning
Support for juptyer nbconvert in StepUp RepRep is experimental.
Expect breaking changes in future releases.
Parameters:
-
path_nb(str) –The input Jupyter notebook.
-
dest(str | None, default:None) –Output destination:
None, a directory or a file. -
inp(str | Collection[str], default:()) –One or more input files used by the notebook. You can also declare inputs with
amend(inp=...)in the notebook, but specifying them here will make the scheduling more efficient. -
out(str | Collection[str], default:()) –One or more output files produced by the notebook. You can also declare outputs with
amend(out=...)in the notebook, but you can specify them here if you want to make the notebook execution optional, i.e. dependent on whether the outputs are used in other steps. -
execute(bool, default:True) –If
True, the notebook is executed before conversion. -
to(str | None, default:None) –The output format. The default depends on the extension of the output file. if
tois given anddestisNoneor a directory, thetoargument is used to determine the output file extension. -
nbargs(str | dict | list | None, default:None) –If
str, it is passed literally as additional argument to the notebook through the environment variableREPREP_NBARGS. Ifdictorlist, it is converted to a JSON string first. The notebook should read this variable withos.getenv("REPREP_NBARGS")and notstepup.core.api.getenv()because the variable is local to the process. It is impossible (and pointless) for the StepUp director to detect changes in this variable. Even if it is globally defined, it will be overridden in this step. -
jupyter(str | None, default:None) –The path to the jupyter executable. Defaults to
${REPREP_JUPYTER}variable orjupyterif the variable is unset. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
pool(str | None, default:None) –The pool in which the step is executed, which may be convenient to limit the number of parallel notebooks being executed, e.g. when the already run calculations in parallel.
-
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 | |
convert_markdown(path_md, dest=None, *, paths_css=(), optional=False, block=False)
¶
Convert a markdown to HTML.
Parameters:
-
path_md(str) –The markdown input file.
-
dest(str | None, default:None) –Output destination:
None, a directory or a file. -
paths_css(str | Collection[str], default:()) –Path or multiple paths of a local CSS file, or a list of multiple such paths, to be included in the HTML header. Note that one may also specify CSS file in the markdown header. Defaults to
${REPREP_MARKDOWN_CSS}if the variable is set, which is interpreted as a colon-separated list of files. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
convert_mutool(path_pdf, path_out, *, resolution=None, mutool=None, optional=False, block=False)
¶
Convert a PDF to a bitmap with mutool (from MuPDF).
Parameters:
-
path_pdf(str) –The input PDF file.
-
path_out(str) –The output image file.
-
resolution(int | None, default:None) –The resolution of the output bitmap in dots per inch (dpi).
-
mutool(str | None, default:None) –The path to the mutool executable. Defaults to
${REPREP_MUTOOL}variable ormutoolif the variable is unset. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
convert_mutool_png(path_pdf, dest=None, *, resolution=None, mutool=None, optional=False, block=False)
¶
Shorthand for convert_mutool with the output file derived from the PDF file.
The dest argument can be None, a directory or a file. See make_path_out.
Source code in stepup/reprep/api.py
convert_odf_pdf(path_odf, dest=None, *, libreoffice=None, optional=False, block=False)
¶
Convert a file in OpenDocument format to PDF.
Parameters:
-
path_odf(str) –The input open-document file.
-
dest(str | None, default:None) –None, output directory or path. See
make_path_out. -
libreoffice(str | None, default:None) –The libreoffice executable. Defaults to
${REPREP_LIBREOFFICE}variable orlibreofficeif the variable is unset. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Notes
This function does not yet scan the source document for reference to external files. which should ideally be added as dependencies.
Source code in stepup/reprep/api.py
convert_weasyprint(path_html, dest=None, *, weasyprint=None, optional=False, block=False)
¶
Convert a HTML document to PDF.
Parameters:
-
path_html(str) –The HTML input file.
-
dest(str | None, default:None) –Output destination:
None, a directory or a file. -
weasyprint(str | None, default:None) –The path to the weasyprint executable. Defaults to
${REPREP_WEASYPRINT}variable orweasyprintif the variable is unset. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
diff_latex(path_old, path_new, path_diff, *, latexdiff=None, latexdiff_args=DEFAULT_LATEXDIFF_ARGS, optional=False, block=False)
¶
Create a step to run latexdiff.
Parameters:
-
path_old(str) –The old tex or bbl source.
-
path_new(str) –The new tex or bbl source.
-
path_diff(str) –The diff output tex or bbl.
-
latexdiff(str | None, default:None) –Path of the latexdiff executable. Defaults to
${REPREP_LATEXDIFF}variable orlatexdiffif the variable is unset. -
latexdiff_args(Collection[str], default:DEFAULT_LATEXDIFF_ARGS) –Additional arguments for latexdiff. Defaults to
${REPREP_LATEXDIFF_ARG}variable. If this variable is unset, the following default is used:--append-context2cmd=abstract,supplementary,dataavailability,funding, \ authorcontributions,conflictsofinterest,abbreviationsThe option
--no-labelis always added because it is needed to make the file reproducible. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
execute_papermill(path_nb, dest, *, inp=(), out=(), parameters=None, optional=False, pool=None, block=False)
¶
Execute a Jupyter Notebook with papermill and save the notebook with outputs as a new file.
Parameters:
-
path_nb(str) –The input Jupyter notebook.
-
dest(str) –Output destination: a directory or a file. The output format is always IPYNB.
-
inp(str | Collection[str], default:()) –One or more input files used by the notebook. You can also declare inputs with
amend(inp=...)in the notebook, but specifying them here will make the scheduling more efficient. -
out(str | Collection[str], default:()) –One or more output files produced by the notebook. You can also declare outputs with
amend(out=...)in the notebook, but you can specify them here if you want to make the notebook execution optional, i.e. dependent on whether the outputs are used in other steps. -
parameters(dict[str] | None, default:None) –The dictionary, if any, must be JSON-serializable. It will be passed to the parameters argument of
papermill.execute_notebook(). -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
pool(str | None, default:None) –The pool in which the step is executed, which may be convenient to limit the number of parallel notebooks being executed, e.g. when the already run calculations in parallel.
-
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 | |
flatten_latex(path_tex, path_flat, *, optional=False, block=False)
¶
Flatten structured LaTeX source files (substitute \input and friends by their content).
Parameters:
-
path_tex(str) –The main tex file to be converted.
-
path_flat(str) –The flattened output file.
-
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
make_inventory(*paths, path_def=None, optional=False, block=False)
¶
Create an inventory.txt file.
Parameters:
-
paths(Collection[str], default:()) –Paths to include in the
inventory.txtfile, except for the last, which is the inventory file to write. -
path_def(str | None, default:None) –An inventory definitions file, used to constructe the list of files.
-
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
nup_pdf(path_src, path_dst, *, nrow=None, ncol=None, margin=None, page_format=None, optional=False, block=False)
¶
Put multiple pages per sheet using a fixed layout.
Parameters:
-
path_src(str) –The original PDF document (with normal pages).
-
path_dst(str) –The output PDF with (multiple pages per sheet).
-
nrow(int | None, default:None) –The number of rows on each output sheet. The default is
${REPREP_NUP_NROW}or 2 if the variable is not set. -
ncol(int | None, default:None) –The number of columns on each output sheet. The default is
${REPREP_NUP_NCOL}or 2 if the variable is not set. -
margin(float | None, default:None) –The margin in mm between the pages on each sheet. (Also used as sheet margin.) The default is
${REPREP_NUP_MARGIN}or 10.0 if the variable is not set. -
page_format(str | None, default:None) –The output page format The default is
${REPREP_NUP_PAGE_FORMAT}or A4-L if the variable is not set. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
raster_pdf(path_inp, dest, *, resolution=None, quality=None, optional=False, block=False)
¶
Turn each page of a PDF into a rendered JPEG bitmap contained in a new PDF.
Parameters:
-
path_inp(str) –The input PDF file.
-
dest(str) –None, output directory or path. See
make_path_out. -
resolution(int | None, default:None) –The resolution of the bitmap in dots per inch (dpi). The default value is taken from
${REPREP_RASTER_RESOLUTION}or 100 if the variable is not set. -
quality(int | None, default:None) –The JPEG quality of the bitmap. The default value is taken from
${REPREP_RASTER_QUALITY}or 50 if the variable is not set. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
sanitize_bibtex(path_bib, *, path_aux=None, path_cfg=None, path_out=None, overwrite=False, optional=False, block=False)
¶
Sanitize a BibTeX file.
Parameters:
-
path_bib(str) –Path to the BibTeX file to be sanitized.
-
path_aux(str | None, default:None) –Paths to LaTeX aux file if any. This is used to detect unused or missing citations.
-
path_cfg(str | None, default:None) –The YAML configuration file for the
rr-sanitize-bibtexscript. -
path_out(str | None, default:None) –If given, a single cleaned-up bibtex file is written as output, which you can manually copy back to the original if you approve of the cleanup. If not given, the original bibtex file is overwritten (if there is only one), which will drain the scheduler. You then check if the updated version is correct and rerun the build to approve.
-
overwrite(bool, default:False) –If
True, it is assumed that you want to overwrite an input bibtex file, in which casepath_outis not treated as a new output file in the workflow. -
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 | |
sync_zenodo(path_config, *, verbose=False, block=False)
¶
Synchronize data with an draft dataset on Zenodo.
Parameters:
-
path_config(str) –The YAML configuration file for the Zenodo upload.
-
verbose(bool, default:False) –Set to True to print Zenodo API requests and responses to the standard output.
-
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
unplot(path_svg, dest=None, *, optional=False, block=False)
¶
Convert a plot back to data.
Parameters:
-
path_svg(str) –The SVG file with paths to be converted back.
-
dest(str | None, default:None) –An output directory or file.
-
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
wrap_git(command, *, out=None, workdir='./', optional=False, block=False)
¶
Create a step to run a git command.
The provide the necessary input for StepUp, git is called through a wrapper script.
This wrapper first infers the git root directory with git rev-parse --show-toplevel.
It then amends the input dependencies with the following two files:
- gitroot / ‘.git/HEAD’
- gitroot / ‘.git/refs/branches/
‘
As a result, the step will be rescheduled when the current commit id or branch changes.
It is recommended to make gitroot / ‘.git/’ and all of its contents static with recursive deferred glob as follows:
Parameters:
-
command(str) –The git command to run, e.g.
git describe --tagsorgit log -n1 --pretty='format:%cs (%h). -
out(str | None, default:None) –An output file for the stdout of the git command.
-
workdir(str, default:'./') –The working directory where the git command must be executed.
-
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.
Source code in stepup/reprep/api.py
1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 | |
zip_inventory(path_inventory, path_zip, *, optional=False, block=False)
¶
Create a ZIP file with all files listed in a inventory.txt file + check digests before zip.
Parameters:
-
path_inventory(str) –A file created with the
make_inventoryAPI or with the command-line scriptrr-make-inventory. -
path_zip(str) –The output ZIP file
-
optional(bool, default:False) –If
True, the step is only executed when needed by other steps. -
block(bool, default:False) –If
True, the step will always remain pending.
Returns:
-
step_info–Holds relevant information of the step, useful for defining follow-up steps.