Skip to content

Commit

Permalink
Revert "Test distributed"
Browse files Browse the repository at this point in the history
This reverts commit 6ddcc5b.
  • Loading branch information
XavierCLL committed Aug 25, 2023
1 parent 6ddcc5b commit 20d5109
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions stack_composed/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,30 +158,6 @@ def stat_func(stack_chunk, metadata):
index_sort = np.argsort(metadata['date']) # from the oldest to most recent
return np.apply_along_axis(linear_trend, 2, stack_chunk, index_sort, metadata['date'])

import os
from dask.distributed import Client, SSHCluster

# get the password from environment variable
password = os.environ.get('PASSWORD')

from stack_composed import stack_composed_main

# Create a list of addresses for your servers
addresses = ['192.168.106.12', '192.168.106.13']

# Specify SSH keys and other SSH settings
connect_options = {
'username': 'smbyc',
'password': password,
'known_hosts': None
}

# Create an SSHCluster instance
cluster = SSHCluster(addresses, connect_options=connect_options, worker_options={"nthreads": 30, "n_workers": 2}, )

# Connect to the cluster
client = Client(cluster)

# Create an instance of BlockCalculator
block_calculator = BlockCalculator(images, band, stat, stat_func, preproc)

Expand All @@ -190,10 +166,6 @@ def stat_func(stack_chunk, metadata):
chunks=wrapper_array.chunks, chunksize=chunksize, dtype=float)
result_array = map_blocks.compute(num_workers=num_process, scheduler="processes")

# Close the client and cluster when done
client.close()
cluster.close()

return result_array


Expand Down

0 comments on commit 20d5109

Please sign in to comment.