Skip to content

Commit 5ac42b7

Browse files
committed
fixing the docs
1 parent a62abc1 commit 5ac42b7

10 files changed

+83
-62
lines changed

AUTHORS.md

+2
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ Authors in order of the timeline of their contributions:
6161
- [William Jamieson](https://github.com/WilliamJamieson) for [NumPy 2.0 compatibility](https://github.com/seperman/deepdiff/pull/422)
6262
- [Leo Sin](https://github.com/leoslf) for Supporting Python 3.12 in the build process
6363
- [sf-tcalhoun](https://github.com/sf-tcalhoun) for fixing "Instantiating a Delta with a flat_dict_list unexpectedly mutates the flat_dict_list"
64+
- [dtorres-sf](https://github.com/dtorres-sf) for fixing iterable moved items when iterable_compare_func is used.
65+
- [Florian Finkernagel](https://github.com/TyberiusPrime) for pandas and polars support.

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# DeepDiff Change log
22

33

4+
- v8-0-0
5+
6+
- With the introduction of `threshold_to_diff_deeper`, the values returned are different than in previous versions of DeepDiff. You can still get the older values by setting `threshold_to_diff_deeper=0`. However to signify that enough has changed in this release that the users need to update the parameters passed to DeepDiff, we will be doing a major version update.
7+
- [x] `use_enum_value=True` makes it so when diffing enum, we use the enum's value. It makes it so comparing an enum to a string or any other value is not reported as a type change.
8+
- [x] `threshold_to_diff_deeper=float` is a number between 0 and 1. When comparing dictionaries that have a small intersection of keys, we will report the dictionary as a `new_value` instead of reporting individual keys changed. If you set it to zero, you get the same results as DeepDiff 7.0.1 and earlier, which means this feature is disabled. The new default is 0.33 which means if less that one third of keys between dictionaries intersect, report it as a new object.
9+
- [x] Deprecated `ordered-set` and switched to `orderly-set`. The `ordered-set` package was not being maintained anymore and starting Python 3.6, there were better options for sets that ordered. I forked one of the new implementations, modified it, and published it as `orderly-set`.
10+
- [x] Added `use_log_scale:bool` and `log_scale_similarity_threshold:float`. They can be used to ignore small changes in numbers by comparing their differences in logarithmic space. This is different than ignoring the difference based on significant digits.
11+
- [x] json serialization of reversed lists.
12+
- [x] Fix for iterable moved items when `iterable_compare_func` is used.
13+
- [x] Pandas and Polars support
14+
15+
416
- v7-0-1
517
- Fixes the translation between Difflib opcodes and Delta flat rows.
618
- v7-0-0

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ Tested on Python 3.8+ and PyPy3.
2323

2424
Please check the [ChangeLog](CHANGELOG.md) file for the detailed information.
2525

26+
DeepDiff 8-0-0
27+
28+
With the introduction of `threshold_to_diff_deeper`, the values returned are different than in previous versions of DeepDiff. You can still get the older values by setting `threshold_to_diff_deeper=0`. However to signify that enough has changed in this release that the users need to update the parameters passed to DeepDiff, we will be doing a major version update.
29+
30+
- [x] `use_enum_value=True` makes it so when diffing enum, we use the enum's value. It makes it so comparing an enum to a string or any other value is not reported as a type change.
31+
- [x] `threshold_to_diff_deeper=float` is a number between 0 and 1. When comparing dictionaries that have a small intersection of keys, we will report the dictionary as a `new_value` instead of reporting individual keys changed. If you set it to zero, you get the same results as DeepDiff 7.0.1 and earlier, which means this feature is disabled. The new default is 0.33 which means if less that one third of keys between dictionaries intersect, report it as a new object.
32+
- [x] Deprecated `ordered-set` and switched to `orderly-set`. The `ordered-set` package was not being maintained anymore and starting Python 3.6, there were better options for sets that ordered. I forked one of the new implementations, modified it, and published it as `orderly-set`.
33+
- [x] Added `use_log_scale:bool` and `log_scale_similarity_threshold:float`. They can be used to ignore small changes in numbers by comparing their differences in logarithmic space. This is different than ignoring the difference based on significant digits.
34+
- [x] json serialization of reversed lists.
35+
- [x] Fix for iterable moved items when `iterable_compare_func` is used.
36+
- [x] Pandas and Polars support
37+
2638
DeepDiff 7-0-1
2739

2840
- Fixes the translation between Difflib opcodes and Delta flat rows.

docs/authors.rst

+4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ Authors in order of the timeline of their contributions:
8989
- `sf-tcalhoun <https://github.com/sf-tcalhoun>`__ for fixing
9090
“Instantiating a Delta with a flat_dict_list unexpectedly mutates the
9191
flat_dict_list”
92+
- `dtorres-sf <https://github.com/dtorres-sf>`__ for fixing iterable
93+
moved items when iterable_compare_func is used.
94+
- `Florian Finkernagel <https://github.com/TyberiusPrime>`__ for pandas
95+
and polars support.
9296

9397
.. _Sep Dehpour (Seperman): http://www.zepworks.com
9498
.. _Victor Hahn Castell: http://hahncastell.de

docs/buildme.py

+11-44
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
It will remove the contents of the BUILD_PATH folder and recreate it.
66
"""
77
import os
8-
import time
98
import datetime
109
import shutil
1110
from dotenv import load_dotenv
12-
from watchdog.observers import Observer
13-
from watchdog.events import FileSystemEventHandler
1411
from sphinx.cmd.build import main as sphinx_main
1512

1613
CACHE_PATH = '/tmp/sphinx_doctree'
@@ -27,45 +24,15 @@ def delete_dir_contents(directory):
2724
shutil.rmtree(directory)
2825

2926

30-
class MyHandler(FileSystemEventHandler):
31-
32-
def __init__(self):
33-
self.last_modified = datetime.datetime.now()
34-
35-
def on_any_event(self, event):
36-
load_dotenv(override=True)
37-
build_path = os.environ.get('BUILD_PATH', '_build')
38-
doc_version = os.environ.get('DOC_VERSION', '')
39-
if not build_path.endswith('/'):
40-
build_path = build_path + '/'
41-
build_path += doc_version
42-
if event is None:
43-
print('initial build')
44-
else:
45-
print(f'event type: {event.event_type} path : {event.src_path}')
46-
if event is not None and (
47-
datetime.datetime.now() - self.last_modified < datetime.timedelta(seconds=2)):
48-
return
49-
else:
50-
self.last_modified = datetime.datetime.now()
51-
argv = ['-b', 'html', '-d', CACHE_PATH, '.', build_path]
52-
ensure_dir(build_path)
53-
delete_dir_contents(build_path)
54-
delete_dir_contents('/tmp/sphinx_doctree') # Disable this for faster build time but it might not properly invalidate the cache
55-
sphinx_main(argv)
56-
print('waiting for file changes. Press Ctrl+c to cancel.')
57-
58-
5927
if __name__ == "__main__":
60-
event_handler = MyHandler()
61-
event_handler.on_any_event(event=None)
62-
observer = Observer()
63-
observer.schedule(event_handler, path='.', recursive=True)
64-
observer.start()
65-
66-
try:
67-
while True:
68-
time.sleep(1)
69-
except KeyboardInterrupt:
70-
observer.stop()
71-
observer.join()
28+
load_dotenv(override=True)
29+
build_path = os.environ.get('BUILD_PATH', '_build')
30+
doc_version = os.environ.get('DOC_VERSION', '')
31+
if not build_path.endswith('/'):
32+
build_path = build_path + '/'
33+
build_path += doc_version
34+
argv = ['-b', 'html', '-d', CACHE_PATH, '.', build_path]
35+
ensure_dir(build_path)
36+
delete_dir_contents(build_path)
37+
delete_dir_contents('/tmp/sphinx_doctree') # Disable this for faster build time but it might not properly invalidate the cache
38+
sphinx_main(argv)

docs/changelog.rst

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ Changelog
55

66
DeepDiff Changelog
77

8+
- With the introduction of `threshold_to_diff_deeper`, the values returned are different than in previous versions of DeepDiff. You can still get the older values by setting `threshold_to_diff_deeper=0`. However to signify that enough has changed in this release that the users need to update the parameters passed to DeepDiff, we will be doing a major version update.
9+
- `use_enum_value=True` makes it so when diffing enum, we use the enum's value. It makes it so comparing an enum to a string or any other value is not reported as a type change.
10+
- `threshold_to_diff_deeper=float` is a number between 0 and 1. When comparing dictionaries that have a small intersection of keys, we will report the dictionary as a `new_value` instead of reporting individual keys changed. If you set it to zero, you get the same results as DeepDiff 7.0.1 and earlier, which means this feature is disabled. The new default is 0.33 which means if less that one third of keys between dictionaries intersect, report it as a new object.
11+
- Deprecated `ordered-set` and switched to `orderly-set`. The `ordered-set` package was not being maintained anymore and starting Python 3.6, there were better options for sets that ordered. I forked one of the new implementations, modified it, and published it as `orderly-set`.
12+
- Added `use_log_scale:bool` and `log_scale_similarity_threshold:float`. They can be used to ignore small changes in numbers by comparing their differences in logarithmic space. This is different than ignoring the difference based on significant digits.
13+
- json serialization of reversed lists.
14+
- Fix for iterable moved items when `iterable_compare_func` is used.
15+
- Pandas and Polars support
816

917
- v7-0-1
1018

docs/ignore_types_or_values.rst

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ ignore_type_in_groups: Tuple or List of Tuples, default = None
108108
2. or ignore_type_in_groups=[(str, bytes), (typeA, typeB)]
109109

110110

111+
Note: The example below shows you have to use this feature. For enum types, however, you can just use :ref:`use_enum_value_label`
112+
111113
Example: Ignore Enum to string comparison
112114
>>> from deepdiff import DeepDiff
113115
>>> from enum import Enum

docs/index.rst

+27-15
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,35 @@ The DeepDiff library includes the following modules:
3131
What Is New
3232
***********
3333

34+
DeepDiff 8-0-0
35+
--------------
36+
37+
- With the introduction of `threshold_to_diff_deeper`, the values returned are different than in previous versions of DeepDiff. You can still get the older values by setting `threshold_to_diff_deeper=0`. However to signify that enough has changed in this release that the users need to update the parameters passed to DeepDiff, we will be doing a major version update.
38+
- `use_enum_value=True` makes it so when diffing enum, we use the enum's value. It makes it so comparing an enum to a string or any other value is not reported as a type change.
39+
- `threshold_to_diff_deeper=float` is a number between 0 and 1. When comparing dictionaries that have a small intersection of keys, we will report the dictionary as a `new_value` instead of reporting individual keys changed. If you set it to zero, you get the same results as DeepDiff 7.0.1 and earlier, which means this feature is disabled. The new default is 0.33 which means if less that one third of keys between dictionaries intersect, report it as a new object.
40+
- Deprecated `ordered-set` and switched to `orderly-set`. The `ordered-set` package was not being maintained anymore and starting Python 3.6, there were better options for sets that ordered. I forked one of the new implementations, modified it, and published it as `orderly-set`.
41+
- Added `use_log_scale:bool` and `log_scale_similarity_threshold:float`. They can be used to ignore small changes in numbers by comparing their differences in logarithmic space. This is different than ignoring the difference based on significant digits.
42+
- json serialization of reversed lists.
43+
- Fix for iterable moved items when `iterable_compare_func` is used.
44+
- Pandas and Polars support
45+
46+
3447
DeepDiff 7-0-0
3548
--------------
3649

37-
- DeepDiff 7 comes with an improved delta object. `Delta to flat
38-
dictionaries <https://zepworks.com/deepdiff/current/serialization.html#delta-serialize-to-flat-dictionaries>`__
39-
have undergone a major change. We have also introduced `Delta
40-
serialize to flat
41-
rows <https://zepworks.com/deepdiff/current/serialization.html#delta-serialize-to-flat-rows>`__.
42-
- Subtracting delta objects have dramatically improved at the cost of
43-
holding more metadata about the original objects.
44-
- When ``verbose=2``, and the “path” of an item has changed in a report
45-
between t1 and t2, we include it as ``new_path``.
46-
- ``path(use_t2=True)`` returns the correct path to t2 in any reported
47-
change in the
48-
```tree view`` <https://zepworks.com/deepdiff/current/view.html#tree-view>`__
49-
- Python 3.7 support is dropped and Python 3.12 is officially
50-
supported.
50+
- DeepDiff 7 comes with an improved delta object. `Delta to flat
51+
dictionaries <https://zepworks.com/deepdiff/current/serialization.html#delta-serialize-to-flat-dictionaries>`__
52+
have undergone a major change. We have also introduced `Delta
53+
serialize to flat
54+
rows <https://zepworks.com/deepdiff/current/serialization.html#delta-serialize-to-flat-rows>`__.
55+
- Subtracting delta objects have dramatically improved at the cost of
56+
holding more metadata about the original objects.
57+
- When ``verbose=2``, and the “path” of an item has changed in a report
58+
between t1 and t2, we include it as ``new_path``.
59+
- ``path(use_t2=True)`` returns the correct path to t2 in any reported
60+
change in the `tree view <https://zepworks.com/deepdiff/current/view.html#tree-view>`__
61+
- Python 3.7 support is dropped and Python 3.12 is officially
62+
supported.
5163

5264

5365
DeepDiff 6-7-1
@@ -57,7 +69,7 @@ DeepDiff 6-7-1
5769
is used.
5870
- Better handling of force adding a delta to an object.
5971
- Fix for
60-
```Can't compare dicts with both single and double quotes in keys`` <https://github.com/seperman/deepdiff/issues/430>`__
72+
`Can't compare dicts with both single and double quotes in keys <https://github.com/seperman/deepdiff/issues/430>`__
6173
- Updated docs for Inconsistent Behavior with math_epsilon and
6274
ignore_order = True
6375

docs/numbers.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,15 @@ use_log_scale: Boolean, default=False
158158
>>>
159159
>>> DeepDiff(t1, t2)
160160
{'values_changed': {"root['foo']": {'new_value': 140, 'old_value': 110}, "root['bar']": {'new_value': 298, 'old_value': 306}}}
161+
161162
>>> DeepDiff(t1, t2, use_log_scale=True, log_scale_similarity_threshold=0.01)
162163
{'values_changed': {"root['foo']": {'new_value': 140, 'old_value': 110}, "root['bar']": {'new_value': 298, 'old_value': 306}}}
164+
163165
>>> DeepDiff(t1, t2, use_log_scale=True, log_scale_similarity_threshold=0.1)
164166
{'values_changed': {"root['foo']": {'new_value': 140, 'old_value': 110}}}
167+
165168
>>> DeepDiff(t1, t2, use_log_scale=True, log_scale_similarity_threshold=0.3)
166-
{
169+
{}
167170

168171

169172
.. _log_scale_similarity_threshold_label:
@@ -172,7 +175,7 @@ Log Scale Similarity Threshold
172175
------------
173176

174177
log_scale_similarity_threshold: float, default = 0.1
175-
:ref:`use_log_scale_label` along with log_scale_similarity_threshold can be used to ignore small changes in numbers by comparing their differences in logarithmic space. This is different than ignoring the difference based on significant digits. See above example.
178+
:ref:`use_log_scale_label` along with log_scale_similarity_threshold can be used to ignore small changes in numbers by comparing their differences in logarithmic space. This is different than ignoring the difference based on significant digits. See the example above.
176179

177180

178181
Performance Improvement of Numbers diffing

requirements-dev.txt

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ numpy==2.0.0
88
pytest==8.2.2
99
pytest-cov==5.0.0
1010
python-dotenv==1.0.1
11-
watchdog>=4.0.1
1211
Sphinx==6.2.1 # We use the html style that is not supported in Sphinx 7 anymore.
1312
sphinx-sitemap==2.6.0
1413
sphinxemoji==0.2.0

0 commit comments

Comments
 (0)