Skip to content

Commit 8551da6

Browse files
authored
Merge pull request #47 from kianmeng/fix-typos
Fix typos
2 parents db88100 + 597d36c commit 8551da6

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Diff for: smmap/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Intialize the smmap package"""
1+
"""Initialize the smmap package"""
22

33
__author__ = "Sebastian Thiel"
44
__contact__ = "[email protected]"

Diff for: smmap/buf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SlidingWindowMapBuffer:
2121
)
2222

2323
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.
2525
:param cursor: if not None, the associated cursor to the file you want to access
2626
If None, you have call begin_access before using the buffer and provide a cursor
2727
:param offset: absolute offset in bytes

Diff for: smmap/mman.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class WindowCursor:
2727
that it must be suited for the somewhat quite different sliding manager. It could be improved, but
2828
I see no real need to do so."""
2929
__slots__ = (
30-
'_manager', # the manger keeping all file regions
30+
'_manager', # the manager keeping all file regions
3131
'_rlist', # a regions list with regions for our file
3232
'_region', # our current class:`MapRegion` or None
3333
'_ofs', # relative offset from the actually mapped area to our start area
@@ -66,7 +66,7 @@ def _destroy(self):
6666
# sometimes, during shutdown, getrefcount is None. Its possible
6767
# to re-import it, however, its probably better to just ignore
6868
# 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.
7070
pass
7171
# END exception handling
7272
# END handle regions
@@ -95,7 +95,7 @@ def __copy__(self):
9595
#{ Interface
9696
def assign(self, rhs):
9797
"""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"""
9999
self._destroy()
100100
self._copy_from(rhs)
101101

@@ -342,7 +342,7 @@ def _collect_lru_region(self, size):
342342
return num_found
343343

344344
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,
346346
see MapCursor.use_region.
347347
:param a: A regions (a)rray
348348
:return: The newly created region"""
@@ -427,7 +427,7 @@ def mapped_memory_size(self):
427427
return self._memory_size
428428

429429
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"""
431431
return self._max_handle_count
432432

433433
def max_mapped_memory_size(self):

Diff for: smmap/test/test_buf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_basics(self):
3030
self.assertRaises(ValueError, SlidingWindowMapBuffer, type(c)()) # invalid cursor
3131
self.assertRaises(ValueError, SlidingWindowMapBuffer, c, fc.size) # offset too large
3232

33-
buf = SlidingWindowMapBuffer() # can create uninitailized buffers
33+
buf = SlidingWindowMapBuffer() # can create uninitialized buffers
3434
assert buf.cursor() is None
3535

3636
# can call end access any time

Diff for: smmap/test/test_mman.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_memman_operation(self):
154154
if man.window_size():
155155
assert man.num_file_handles() == 2
156156
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
158158
assert rr.client_count() == 1 # only held by manager
159159
else:
160160
assert c.size() < fc.size
@@ -194,7 +194,7 @@ def test_memman_operation(self):
194194
# precondition
195195
if man.window_size():
196196
assert max_mapped_memory_size >= mapped_memory_size()
197-
# END statics will overshoot, which is fine
197+
# END statistics will overshoot, which is fine
198198
assert max_file_handles >= num_file_handles()
199199
assert c.use_region(base_offset, (size or c.size())).is_valid()
200200
csize = c.size()
@@ -205,7 +205,7 @@ def test_memman_operation(self):
205205
assert includes_ofs(base_offset + csize - 1)
206206
assert not includes_ofs(base_offset + csize)
207207
# 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
209209
mb = float(1000 * 1000)
210210
print("%s: Read %i mb of memory with %i random on cursor initialized with %s accesses in %fs (%f mb/s)\n"
211211
% (mtype, memory_read / mb, max_random_accesses, type(item), elapsed, (memory_read / mb) / elapsed),

0 commit comments

Comments
 (0)