thenamelisttool.entrypoints.tntdiff

TNTdiff - The Namelist Tool: a namelist comparator.

Compares two namelists and produce the following outputs:

  • (default) a TNT directives file to go from one (before/-b) to the other

    (after/-a);

  • (-H option) a HTML file that displays the differences in a table

  • (-V or -v) a summary of the differences on the standard output

  • (-e option) a visualisation of the differences in an external tool

Beware that TNTdiff (purposely) DO NOT take into account:

  • Differences in the order of appearance of namelists blocks or keys

  • Differences in the formatting of namelist values (e.g 1.0 and 1.0000 are considered the same)

With the -H, -V, -v or -e options, the displayed namelists DO NOT necessarily correspond to the original files since, prior to be displayed, blocks/keys are ordered alphabetically and values are formatted in a “standard” way.

Functions

thenamelisttool.entrypoints.tntdiff.actual_main(before_filename, after_filename, outfilename)[source]

Compare two namelists and return directives to go from one (before) to the other (after).

Parameters:

outfilename – output file in which to store directives (.py). Or None if not required.

thenamelisttool.entrypoints.tntdiff.extdiff(before_filename, after_filename, tool)[source]

Visualise the differences with an external tool such as vim or meld.

thenamelisttool.entrypoints.tntdiff.htmldiff_view(before_filename, after_filename, outfilename)[source]

Create an HTML representation of the differences and open a web browser.

thenamelisttool.entrypoints.tntdiff.main()[source]

Start the tntdiff CLI.

thenamelisttool.entrypoints.tntdiff.visualdiff(before_filename, after_filename, bw=False)[source]

Print a nicely formated text representation of the differences.