@@ -321,8 +321,16 @@ def _format_change_value(value):
321321 def diff (self , ref , comp , * args , ** kwargs ):
322322 """Compare 2 dictionnaries.
323323
324- This function calls :func:`dictdiffer.diff`, read the doc of this function for details on
325- args and kwargs.
324+ This function calls :func:`dictdiffer.diff` to compare the dictionaries, read the doc of
325+ this function for details on args and kwargs.
326+
327+ Keyword Args:
328+ tolerance: Relative threshold to consider when comparing two float numbers.
329+ absolute_tolerance: Absolute threshold to consider when comparing
330+ two float numbers.
331+ ignore: Set of keys that should not be checked.
332+ path_limit: List of path limit tuples or :class:`dictdiffer.utils.Pathlimit`
333+ object to limit the diff recursion depth.
326334 """
327335 if len (args ) > 5 :
328336 dot_notation = args [5 ]
@@ -342,7 +350,10 @@ def format_diff(self, difference):
342350
343351
344352class JsonComparator (DictComparator ):
345- """Comparator for JSON files."""
353+ """Comparator for JSON files.
354+
355+ This comparator is based on the :class:`DictComparator` and uses the same parameters.
356+ """
346357
347358 def load (self , path ):
348359 """Open a JSON file."""
@@ -352,7 +363,10 @@ def load(self, path):
352363
353364
354365class YamlComparator (DictComparator ):
355- """Comparator for YAML files."""
366+ """Comparator for YAML files.
367+
368+ This comparator is based on the :class:`DictComparator` and uses the same parameters.
369+ """
356370
357371 def load (self , path ):
358372 """Open a YAML file."""
@@ -364,6 +378,8 @@ def load(self, path):
364378class XmlComparator (DictComparator ):
365379 """Comparator for XML files.
366380
381+ This comparator is based on the :class:`DictComparator` and uses the same parameters.
382+
367383 .. warning:: The XML files must have only one root.
368384
369385 .. note::
@@ -447,13 +463,26 @@ def xmltodict(obj):
447463
448464
449465class PdfComparator (BaseComparator ):
450- """Compartor for PDF files."""
466+ """Comparator for PDF files."""
451467
452468 def diff (self , ref , comp , * args , ** kwargs ):
453469 """Compare data from two PDF files.
454470
455471 This function calls the `diff_pdf_visually.pdfdiff() <https://github.com/bgeron/diff-pdf-
456472 visually/blob/21e85f1db1bdaee5c0e8e0b730771d6c4e8c3e44/diff_pdf_visually/diff.py#L83>`_
457473 function, read the doc of this function for details on args and kwargs.
474+ It compares the visual aspects of the PDF files, ignoring the invisible content (e.g. file
475+ header or invisible things like white font on white background). The PDF files are converted
476+ into images using ``ImageMagick`` and then these images are compared.
477+
478+ Keyword Args:
479+ threshold (int): The threshold used to compare the images.
480+ tempdir (pathlib.Path): Empty directory where the temporary images will be exported.
481+ dpi (int): The resolution used to convert the PDF files into images.
482+ verbosity (int): The log verbosity.
483+ max_report_pagenos (int): Only this number of the different pages will be logged (only
484+ used if the verbosity is greater than 1).
485+ num_threads (int): If set to 2 (the default), the image conversion are processed in
486+ parallel. If set to 1 it is processed sequentially.
458487 """
459488 return not pdfdiff (ref , comp , * args , ** kwargs )
0 commit comments