diff --git a/smmap/__init__.py b/smmap/__init__.py index 696401c..6b1a44c 100644 --- a/smmap/__init__.py +++ b/smmap/__init__.py @@ -1,4 +1,4 @@ -"""Intialize the smmap package""" +"""Initialize the smmap package""" __author__ = "Sebastian Thiel" __contact__ = "byronimo@gmail.com" diff --git a/smmap/buf.py b/smmap/buf.py index 795e0fd..ad27b69 100644 --- a/smmap/buf.py +++ b/smmap/buf.py @@ -21,7 +21,7 @@ class SlidingWindowMapBuffer: ) def __init__(self, cursor=None, offset=0, size=sys.maxsize, flags=0): - """Initalize the instance to operate on the given cursor. + """Initialize the instance to operate on the given cursor. :param cursor: if not None, the associated cursor to the file you want to access If None, you have call begin_access before using the buffer and provide a cursor :param offset: absolute offset in bytes diff --git a/smmap/mman.py b/smmap/mman.py index 1de7d9e..873f687 100644 --- a/smmap/mman.py +++ b/smmap/mman.py @@ -27,7 +27,7 @@ class WindowCursor: that it must be suited for the somewhat quite different sliding manager. It could be improved, but I see no real need to do so.""" __slots__ = ( - '_manager', # the manger keeping all file regions + '_manager', # the manager keeping all file regions '_rlist', # a regions list with regions for our file '_region', # our current class:`MapRegion` or None '_ofs', # relative offset from the actually mapped area to our start area @@ -66,7 +66,7 @@ def _destroy(self): # sometimes, during shutdown, getrefcount is None. Its possible # to re-import it, however, its probably better to just ignore # this python problem (for now). - # The next step is to get rid of the error prone getrefcount alltogether. + # The next step is to get rid of the error prone getrefcount altogether. pass # END exception handling # END handle regions @@ -95,7 +95,7 @@ def __copy__(self): #{ Interface def assign(self, rhs): """Assign rhs to this instance. This is required in order to get a real copy. - Alternativly, you can copy an existing instance using the copy module""" + Alternatively, you can copy an existing instance using the copy module""" self._destroy() self._copy_from(rhs) @@ -342,7 +342,7 @@ def _collect_lru_region(self, size): return num_found def _obtain_region(self, a, offset, size, flags, is_recursive): - """Utilty to create a new region - for more information on the parameters, + """Utility to create a new region - for more information on the parameters, see MapCursor.use_region. :param a: A regions (a)rray :return: The newly created region""" @@ -427,7 +427,7 @@ def mapped_memory_size(self): return self._memory_size def max_file_handles(self): - """:return: maximium amount of handles we may have opened""" + """:return: maximum amount of handles we may have opened""" return self._max_handle_count def max_mapped_memory_size(self): diff --git a/smmap/test/test_buf.py b/smmap/test/test_buf.py index 17555af..f0a86fb 100644 --- a/smmap/test/test_buf.py +++ b/smmap/test/test_buf.py @@ -30,7 +30,7 @@ def test_basics(self): self.assertRaises(ValueError, SlidingWindowMapBuffer, type(c)()) # invalid cursor self.assertRaises(ValueError, SlidingWindowMapBuffer, c, fc.size) # offset too large - buf = SlidingWindowMapBuffer() # can create uninitailized buffers + buf = SlidingWindowMapBuffer() # can create uninitialized buffers assert buf.cursor() is None # can call end access any time diff --git a/smmap/test/test_mman.py b/smmap/test/test_mman.py index d88316b..7a5f409 100644 --- a/smmap/test/test_mman.py +++ b/smmap/test/test_mman.py @@ -154,7 +154,7 @@ def test_memman_operation(self): if man.window_size(): assert man.num_file_handles() == 2 assert c.size() < size - assert c.region() is not rr # old region is still available, but has not curser ref anymore + assert c.region() is not rr # old region is still available, but has not cursor ref anymore assert rr.client_count() == 1 # only held by manager else: assert c.size() < fc.size @@ -194,7 +194,7 @@ def test_memman_operation(self): # precondition if man.window_size(): assert max_mapped_memory_size >= mapped_memory_size() - # END statics will overshoot, which is fine + # END statistics will overshoot, which is fine assert max_file_handles >= num_file_handles() assert c.use_region(base_offset, (size or c.size())).is_valid() csize = c.size() @@ -205,7 +205,7 @@ def test_memman_operation(self): assert includes_ofs(base_offset + csize - 1) assert not includes_ofs(base_offset + csize) # END while we should do an access - elapsed = max(time() - st, 0.001) # prevent zero divison errors on windows + elapsed = max(time() - st, 0.001) # prevent zero division errors on windows mb = float(1000 * 1000) print("%s: Read %i mb of memory with %i random on cursor initialized with %s accesses in %fs (%f mb/s)\n" % (mtype, memory_read / mb, max_random_accesses, type(item), elapsed, (memory_read / mb) / elapsed),