-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The problem is in how I changed update_queue - the flatten().to_list(…
…) bit applied to the queue type works fine with a single ObsID and a single or multiple expected output types, but it doesn't work with multiple ObsIDs because it still makes it completely flat rather than having one type entry (be it a string or an array) for each command. Adding some diagnostics to figure out the best solution
- Loading branch information
Showing
2 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS). | ||
# Last modified by David J Turner ([email protected]) 01/03/2025, 14:27. Copyright (c) The Contributors | ||
# Last modified by David J Turner ([email protected]) 01/03/2025, 15:38. Copyright (c) The Contributors | ||
|
||
from functools import wraps | ||
from multiprocessing.dummy import Pool | ||
|
@@ -52,7 +52,7 @@ def wrapper(*args, **kwargs): | |
all_path = [] # Combined expected path list for all sources | ||
all_extras = [] # Combined extra information list for all sources | ||
source_rep = [] # For repr calls of each source object, needed for assigning products to sources | ||
print(len(cmd_list)) | ||
|
||
for ind in range(len(cmd_list)): | ||
source = sources[ind] | ||
if len(cmd_list[ind]) > 0: | ||
|
@@ -68,6 +68,7 @@ def wrapper(*args, **kwargs): | |
# elegant solution but oh well). | ||
if to_execute: | ||
to_run, expected_type, expected_path, extras = source.get_queue() | ||
print(expected_type) | ||
all_run += to_run | ||
all_type.append(expected_type) | ||
all_path += expected_path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS). | ||
# Last modified by David J Turner ([email protected]) 28/02/2025, 22:16. Copyright (c) The Contributors | ||
# Last modified by David J Turner ([email protected]) 01/03/2025, 15:38. Copyright (c) The Contributors | ||
|
||
import os | ||
import pickle | ||
|
@@ -2494,6 +2494,9 @@ def get_queue(self) -> Tuple[List[str], List[str], List[List[str]], List[dict]]: | |
extras = [] | ||
elif len(self.queue.shape) == 1 or self.queue.shape[1] <= 1: | ||
processed_cmds = list(self.queue) | ||
|
||
print(list(self.queue_type)) | ||
|
||
types = self.queue_type.flatten().tolist() | ||
# The expected output paths can now be either a string or a list - hence the ternary logic | ||
paths = [[path] if isinstance(path, str) else list(path) for path in self.queue_path] | ||
|