GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — enough coverage · benthomasson/deepdiff@5b4fc49

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • deepdiff
    • diff.py
    • lfucache.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deepdiff/diff.py‎

Copy file name to clipboardExpand all lines: deepdiff/diff.py
+1-10Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def _report_progress(_stats, progress_logger, duration):
6565
PASSES_COUNT = 'PASSES COUNT'
6666
MAX_PASS_LIMIT_REACHED = 'MAX PASS LIMIT REACHED'
6767
MAX_DIFF_LIMIT_REACHED = 'MAX DIFF LIMIT REACHED'
68-
INPROGRESS = 'INPROGRESS'
6968
CANT_FIND_NUMPY_MSG = 'Unable to import numpy. This must be a bug in DeepDiff since a numpy array is detected.'
7069
INVALID_VIEW_MSG = 'The only valid values for the view parameter are text and tree. But {} was passed.'
7170
CUTOFF_RANGE_ERROR_MSG = 'cutoff_distance_for_pairs needs to be a positive float max 1.'
@@ -697,16 +696,8 @@ def __get_and_cache_rough_distance(
697696
if cache_key in self._cache:
698697
self._stats[DISTANCE_CACHE_HIT_COUNT] += 1
699698
_current_value = self._cache.get(cache_key)
700-
# We are in a self loop. Get out now!
701-
if _current_value == INPROGRESS:
702-
_distance = 1
703-
else:
704-
_distance = _current_value
699+
_distance = _current_value
705700
else:
706-
# Marking the cache as in progress so we avoid calculating the same distance
707-
# as a part of the distance calculations. Basically to avoid getting stuck when there is a loop
708-
# in the object.
709-
self._cache.set(cache_key, value=INPROGRESS)
710701
# We can only cache the rough distance and not the actual diff result for reuse.
711702
# The reason is that we have modified the parameters explicitly so they are different and can't
712703
# be used for diff reporting
Collapse file

‎deepdiff/lfucache.py‎

Copy file name to clipboardExpand all lines: deepdiff/lfucache.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class LFUCache:
115115
def __init__(self, capacity):
116116
self.cache = {} # {key: cache_node}
117117
if capacity <= 0:
118-
raise ValueError('Capacity of LFUCache needs to be positive.')
118+
raise ValueError('Capacity of LFUCache needs to be positive.') # pragma: no cover.
119119
self.capacity = capacity
120120
self.freq_link_head = None
121121
self.lock = Lock()

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.