Skip to content

Commit

Permalink
Fix annotations breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Jul 28, 2023
1 parent 80feda2 commit 319ed2c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions python/kvikio/_lib/libkvikio.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# cython: language_level=3

import pathlib
from typing import Optional

from libc.stdint cimport uintptr_t
from libcpp.utility cimport move, pair
Expand Down Expand Up @@ -49,7 +50,7 @@ def memory_deregister(buf) -> None:
kvikio_cxx_api.memory_deregister(<void*>arr.ptr)


def compat_mode() -> int:
def compat_mode() -> bool:
return kvikio_cxx_api.compat_mode()


Expand Down Expand Up @@ -124,7 +125,7 @@ cdef class CuFile:
def open_flags(self) -> int:
return self._handle.fd_open_flags()

def pread(self, buf, size: int, file_offset: int, task_size) -> IOFuture:
def pread(self, buf, size: Optional[int], file_offset: int, task_size) -> IOFuture:
cdef pair[uintptr_t, size_t] info = _parse_buffer(buf, size, True)
return _wrap_io_future(
self._handle.pread(
Expand All @@ -135,7 +136,7 @@ cdef class CuFile:
)
)

def pwrite(self, buf, size: int, file_offset: int, task_size) -> IOFuture:
def pwrite(self, buf, size: Optional[int], file_offset: int, task_size) -> IOFuture:
cdef pair[uintptr_t, size_t] info = _parse_buffer(buf, size, True)
return _wrap_io_future(
self._handle.pwrite(
Expand All @@ -146,7 +147,7 @@ cdef class CuFile:
)
)

def read(self, buf, size: int, file_offset: int, dev_offset: int) -> int:
def read(self, buf, size: Optional[int], file_offset: int, dev_offset: int) -> int:
cdef pair[uintptr_t, size_t] info = _parse_buffer(buf, size, False)
return self._handle.read(
<void*>info.first,
Expand All @@ -155,7 +156,7 @@ cdef class CuFile:
dev_offset,
)

def write(self, buf, size: int, file_offset: int, dev_offset: int) -> int:
def write(self, buf, size: Optional[int], file_offset: int, dev_offset: int) -> int:
cdef pair[uintptr_t, size_t] info = _parse_buffer(buf, size, False)
return self._handle.write(
<void*>info.first,
Expand Down

0 comments on commit 319ed2c

Please sign in to comment.