Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
  • Loading branch information
madsbk and bdice committed Sep 9, 2024
1 parent 0403686 commit 0001265
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cpp/include/kvikio/remote_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class S3Context {
*
* @throws std::runtime_error If failing to authenticate to the S3 server.
*
* @param endpoint_override If not empty, the address of the S3 server. This takes precedences
* @param endpoint_override If not empty, the address of the S3 server. This takes precedence
* over the AWS system configuration including the `AWS_ENDPOINT_URL` environment variable.
*/
S3Context(std::string const& endpoint_override = "") : _shutdown_s3_api{true}
Expand All @@ -140,7 +140,7 @@ class S3Context {
Aws::SDKOptions options;
Aws::InitAPI(options);

// Create a client config where `endpoint_override` takes precedences over `AWS_ENDPOINT_URL`
// Create a client config where `endpoint_override` takes precedence over `AWS_ENDPOINT_URL`
Aws::Client::ClientConfiguration config;
char const* ep = std::getenv("AWS_ENDPOINT_URL");
if (!endpoint_override.empty()) {
Expand Down Expand Up @@ -318,7 +318,7 @@ class RemoteHandle {
* @param buf Pointer to host or device memory.
* @param size Number of bytes to read.
* @param file_offset File offset in bytes.
* @return Number of bytes read, which is `size` always.
* @return Number of bytes read, which is always `size`.
*/
std::size_t read(void* buf, std::size_t size, std::size_t file_offset = 0)
{
Expand Down
2 changes: 1 addition & 1 deletion python/kvikio/kvikio/benchmarks/aws_s3_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def start_s3_server(lifetime: int):
from moto.server import ThreadedMotoServer

# Silence the activity info from ThreadedMotoServer
sys.stderr = open("/dev/null", "w")
sys.stderr = open(os.devnull, "w")
url = urlparse(os.environ["AWS_ENDPOINT_URL"])
server = ThreadedMotoServer(ip_address=url.hostname, port=url.port)
server.start()
Expand Down
8 changes: 4 additions & 4 deletions python/kvikio/kvikio/remote_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, context: S3Context, bucket_name: str, object_name: str):
Parameters
----------
context
The S3 context used for the connection to the remove server.
The S3 context used for the connection to the remote server.
bucket_name
Name of the bucket.
object_name
Expand All @@ -84,7 +84,7 @@ def from_url(cls, context: S3Context, url: str) -> RemoteFile:
Parameters
----------
context
The S3 context used for the connection to the remove server.
The S3 context used for the connection to the remote server.
url
URL to the remote file.
Expand Down Expand Up @@ -118,7 +118,7 @@ def read(self, buf, size: Optional[int] = None, file_offset: int = 0) -> int:
Parameters
----------
buf: buffer-like or array-like
buf : buffer-like or array-like
Device or host buffer to read into.
size
Size in bytes to read.
Expand All @@ -136,7 +136,7 @@ def pread(self, buf, size: Optional[int] = None, file_offset: int = 0) -> IOFutu
Parameters
----------
buf: buffer-like or array-like
buf : buffer-like or array-like
Device or host buffer to read into.
size
Size in bytes to read.
Expand Down
4 changes: 2 additions & 2 deletions python/kvikio/tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def skipif_libcudf_s3_io_option_is_not_available() -> None:
cudf.get_option("libcudf_s3_io")
except KeyError:
pytest.skip(
"""cudf doesn't has the "libcudf_s3_io" option, """
"cudf doesn't have the 'libcudf_s3_io' option, "
"see <https://github.com/rapidsai/cudf/pull/16499>"
)

Expand All @@ -113,7 +113,7 @@ def test_aws_s3_io(run_cmd, api):
pytest.skip(
"cannot test remote IO, please build KvikIO with with AWS S3 support"
)
# Fail early if benchmark dependencies isn't available
# Fail early if benchmark dependencies aren't available
import boto3 # noqa: F401
import moto # noqa: F401

Expand Down

0 comments on commit 0001265

Please sign in to comment.