Skip to content

Commit

Permalink
Removed not passed parameters to dask, removed print statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenfus committed Nov 15, 2023
1 parent fa6dd0d commit 8aaf707
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 0 additions & 3 deletions karabo/test/test_source_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ def test_full_source_detection(tobject: TFiles):
)
detected = detection_result.get_pixel_position_of_sources()
mse = np.linalg.norm(gtruth - detected, axis=1)
print(mse)
assert np.all(mse < 1), "Source detection is not correct"

# Now compare it with splitting the image
Expand All @@ -229,8 +228,6 @@ def test_full_source_detection(tobject: TFiles):
# Sometimes the order of the sources is different, so we need to sort them
detected = detected[np.argsort(detected[:, 0])]
gtruth = gtruth[np.argsort(gtruth[:, 0])]
print(detected)
print(gtruth)
mse = np.linalg.norm(gtruth - detected, axis=1)
assert np.all(mse < 1), "Source detection is not correct"

Expand Down
6 changes: 1 addition & 5 deletions karabo/util/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ def calculate_number_of_workers_per_node(

def get_local_dask_client(
memory_limit: Optional[IntFloat],
processes: bool = True,
) -> Client:
# Calculate number of workers per node
n_workers = calculate_number_of_workers_per_node(memory_limit)
Expand Down Expand Up @@ -366,9 +365,7 @@ async def start_nanny(scheduler_address: str) -> Nanny:


def setup_dask_for_slurm(
n_workers_scheduler_node: int,
memory_limit: Optional[IntFloat],
**kwargs: Any,
n_workers_scheduler_node: int, memory_limit: Optional[IntFloat]
) -> Client:
if is_first_node():
# Create file to show that the run is still ongoing
Expand All @@ -380,7 +377,6 @@ def setup_dask_for_slurm(
ip=get_node_name(),
n_workers=n_workers_scheduler_node,
threads_per_worker=DaskHandler.n_threads_per_worker,
**kwargs,
)
dask_client = Client(cluster, proccesses=DaskHandler.use_proccesses)

Check warning on line 381 in karabo/util/dask.py

View check run for this annotation

Codecov / codecov/patch

karabo/util/dask.py#L381

Added line #L381 was not covered by tests

Expand Down

0 comments on commit 8aaf707

Please sign in to comment.