Skip to content

Commit

Permalink
Rename and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Jul 29, 2024
1 parent 41f7f01 commit d91895c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Added minimal Run classes ([#6](https://github.com/neptune-ai/neptune-client-scale/pull/6))
- Added support for `max_queue_size` and `max_queue_size_exceeded_callback` parameters in `Run` ([#7](https://github.com/neptune-ai/neptune-client-scale/pull/7))
14 changes: 7 additions & 7 deletions src/neptune_scale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def __init__(
api_token: str,
family: str,
run_id: str,
queue_max_size: int = MAX_QUEUE_SIZE,
queue_max_size_exceeded_callback: Callable[[int, BaseException], None] | None = None,
max_queue_size: int = MAX_QUEUE_SIZE,
max_queue_size_exceeded_callback: Callable[[int, BaseException], None] | None = None,
) -> None:
"""
Initializes a run that logs the model-building metadata to Neptune.
Expand All @@ -52,15 +52,15 @@ def __init__(
family: Identifies related runs. For example, the same value must apply to all runs within a run hierarchy.
Max length: 128 characters.
run_id: Unique identifier of a run. Must be unique within the project. Max length: 128 characters.
queue_max_size: Maximum number of operations that can be queued before the queue is considered full.
queue_max_size_exceeded_callback: Callback function called when the queue is full. Accepts two arguments:
max_queue_size: Maximum number of operations that can be queued before the queue is considered full.
max_queue_size_exceeded_callback: Callback function called when the queue is full. Accepts two arguments:
the maximum size of the queue and the exception that caused the queue to be full.
"""
verify_type("api_token", api_token, str)
verify_type("family", family, str)
verify_type("run_id", run_id, str)
verify_type("queue_max_size", queue_max_size, int)
verify_type("queue_max_size_exceeded_callback", queue_max_size_exceeded_callback, (Callable, type(None)))
verify_type("max_queue_size", max_queue_size, int)
verify_type("max_queue_size_exceeded_callback", max_queue_size_exceeded_callback, (Callable, type(None)))

verify_non_empty("api_token", api_token)
verify_non_empty("family", family)
Expand All @@ -78,7 +78,7 @@ def __init__(

self._lock = threading.RLock()
self._operations_queue: OperationsQueue = OperationsQueue(
lock=self._lock, max_size=queue_max_size, max_size_exceeded_callback=queue_max_size_exceeded_callback
lock=self._lock, max_size=max_queue_size, max_size_exceeded_callback=max_queue_size_exceeded_callback
)

def __enter__(self) -> Run:
Expand Down

0 comments on commit d91895c

Please sign in to comment.