| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - """Intialize the smmap package""" | ||
| 1 | + """Initialize the smmap package""" | ||
| 2 | 2 | ||
| 3 | 3 | __author__ = "Sebastian Thiel" | |
| 4 | 4 | __contact__ = "byronimo@gmail.com" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ class SlidingWindowMapBuffer: | |||
| 21 | 21 | ) | |
| 22 | 22 | ||
| 23 | 23 | def __init__(self, cursor=None, offset=0, size=sys.maxsize, flags=0): | |
| 24 | - """Initalize the instance to operate on the given cursor. | ||
| 24 | + """Initialize the instance to operate on the given cursor. | ||
| 25 | 25 | :param cursor: if not None, the associated cursor to the file you want to access | |
| 26 | 26 | If None, you have call begin_access before using the buffer and provide a cursor | |
| 27 | 27 | :param offset: absolute offset in bytes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ class WindowCursor: | |||
| 27 | 27 | that it must be suited for the somewhat quite different sliding manager. It could be improved, but | |
| 28 | 28 | I see no real need to do so.""" | |
| 29 | 29 | __slots__ = ( | |
| 30 | - '_manager', # the manger keeping all file regions | ||
| 30 | + '_manager', # the manager keeping all file regions | ||
| 31 | 31 | '_rlist', # a regions list with regions for our file | |
| 32 | 32 | '_region', # our current class:`MapRegion` or None | |
| 33 | 33 | '_ofs', # relative offset from the actually mapped area to our start area | |
@@ -66,7 +66,7 @@ def _destroy(self): | |||
| 66 | 66 | # sometimes, during shutdown, getrefcount is None. Its possible | |
| 67 | 67 | # to re-import it, however, its probably better to just ignore | |
| 68 | 68 | # this python problem (for now). | |
| 69 | - # The next step is to get rid of the error prone getrefcount alltogether. | ||
| 69 | + # The next step is to get rid of the error prone getrefcount altogether. | ||
| 70 | 70 | pass | |
| 71 | 71 | # END exception handling | |
| 72 | 72 | # END handle regions | |
@@ -95,7 +95,7 @@ def __copy__(self): | |||
| 95 | 95 | #{ Interface | |
| 96 | 96 | def assign(self, rhs): | |
| 97 | 97 | """Assign rhs to this instance. This is required in order to get a real copy. | |
| 98 | - Alternativly, you can copy an existing instance using the copy module""" | ||
| 98 | + Alternatively, you can copy an existing instance using the copy module""" | ||
| 99 | 99 | self._destroy() | |
| 100 | 100 | self._copy_from(rhs) | |
| 101 | 101 | ||
@@ -342,7 +342,7 @@ def _collect_lru_region(self, size): | |||
| 342 | 342 | return num_found | |
| 343 | 343 | ||
| 344 | 344 | def _obtain_region(self, a, offset, size, flags, is_recursive): | |
| 345 | - """Utilty to create a new region - for more information on the parameters, | ||
| 345 | + """Utility to create a new region - for more information on the parameters, | ||
| 346 | 346 | see MapCursor.use_region. | |
| 347 | 347 | :param a: A regions (a)rray | |
| 348 | 348 | :return: The newly created region""" | |
@@ -427,7 +427,7 @@ def mapped_memory_size(self): | |||
| 427 | 427 | return self._memory_size | |
| 428 | 428 | ||
| 429 | 429 | def max_file_handles(self): | |
| 430 | - """:return: maximium amount of handles we may have opened""" | ||
| 430 | + """:return: maximum amount of handles we may have opened""" | ||
| 431 | 431 | return self._max_handle_count | |
| 432 | 432 | ||
| 433 | 433 | def max_mapped_memory_size(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,7 @@ def test_basics(self): | |||
| 30 | 30 | self.assertRaises(ValueError, SlidingWindowMapBuffer, type(c)()) # invalid cursor | |
| 31 | 31 | self.assertRaises(ValueError, SlidingWindowMapBuffer, c, fc.size) # offset too large | |
| 32 | 32 | ||
| 33 | - buf = SlidingWindowMapBuffer() # can create uninitailized buffers | ||
| 33 | + buf = SlidingWindowMapBuffer() # can create uninitialized buffers | ||
| 34 | 34 | assert buf.cursor() is None | |
| 35 | 35 | ||
| 36 | 36 | # can call end access any time | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -154,7 +154,7 @@ def test_memman_operation(self): | |||
| 154 | 154 | if man.window_size(): | |
| 155 | 155 | assert man.num_file_handles() == 2 | |
| 156 | 156 | assert c.size() < size | |
| 157 | - assert c.region() is not rr # old region is still available, but has not curser ref anymore | ||
| 157 | + assert c.region() is not rr # old region is still available, but has not cursor ref anymore | ||
| 158 | 158 | assert rr.client_count() == 1 # only held by manager | |
| 159 | 159 | else: | |
| 160 | 160 | assert c.size() < fc.size | |
@@ -194,7 +194,7 @@ def test_memman_operation(self): | |||
| 194 | 194 | # precondition | |
| 195 | 195 | if man.window_size(): | |
| 196 | 196 | assert max_mapped_memory_size >= mapped_memory_size() | |
| 197 | - # END statics will overshoot, which is fine | ||
| 197 | + # END statistics will overshoot, which is fine | ||
| 198 | 198 | assert max_file_handles >= num_file_handles() | |
| 199 | 199 | assert c.use_region(base_offset, (size or c.size())).is_valid() | |
| 200 | 200 | csize = c.size() | |
@@ -205,7 +205,7 @@ def test_memman_operation(self): | |||
| 205 | 205 | assert includes_ofs(base_offset + csize - 1) | |
| 206 | 206 | assert not includes_ofs(base_offset + csize) | |
| 207 | 207 | # END while we should do an access | |
| 208 | - elapsed = max(time() - st, 0.001) # prevent zero divison errors on windows | ||
| 208 | + elapsed = max(time() - st, 0.001) # prevent zero division errors on windows | ||
| 209 | 209 | mb = float(1000 * 1000) | |
| 210 | 210 | print("%s: Read %i mb of memory with %i random on cursor initialized with %s accesses in %fs (%f mb/s)\n" | |
| 211 | 211 | % (mtype, memory_read / mb, max_random_accesses, type(item), elapsed, (memory_read / mb) / elapsed), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments