Skip to content

Fix typos #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion smmap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Intialize the smmap package"""
"""Initialize the smmap package"""

__author__ = "Sebastian Thiel"
__contact__ = "byronimo@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion smmap/buf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions smmap/mman.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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"""
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion smmap/test/test_buf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions smmap/test/test_mman.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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),
Expand Down