-
Notifications
You must be signed in to change notification settings - Fork 134
Closed
Description
Considering spatial_variability is very computationally demanding, it'd be nice to add a progress bar (tqdm) to the for-loop here:
Lines 1217 to 1225 in 5e7fa3f
| for x in range(n_iters): | |
| temp_coords = np.random.permutation(self.model.coords) | |
| temp_sel.coords = temp_coords | |
| temp_bw = temp_sel.search(**search_params) | |
| temp_gwr.bw = temp_bw | |
| temp_gwr.coords = temp_coords | |
| temp_params = temp_gwr.fit(**fit_params).params | |
| temp_sd = np.std(temp_params, axis=0) | |
| SDs.append(temp_sd) |
tqdm is already used here
Lines 202 to 209 in 5e7fa3f
| try: | |
| from tqdm.auto import tqdm #if they have it, let users have a progress bar | |
| except ImportError: | |
| def tqdm(x, desc=''): #otherwise, just passthrough the range | |
| return x | |
| for iters in tqdm(range(1, max_iter + 1), desc='Backfitting'): |
so I guess the same code should work:
try:
from tqdm.auto import tqdm #if they have it, let users have a progress bar
except ImportError:
def tqdm(x, desc=""): #otherwise, just passthrough the range
return x
for x in tqdm(range(n_iters), desc="Testing"): # Is "Testing" the right description? ¯\_(ツ)_/¯
# ...Let me know what you think. I can do the PR (If this is the case, I'd need ideas for the description text: desc="Testing" ?)
Metadata
Metadata
Assignees
Labels
No labels