dasksf 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dasksf-0.1.0/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Verity Allan
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dasksf-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.3
2
+ Name: dasksf
3
+ Version: 0.1.0
4
+ Summary: Radio astronomy source finding using dask and plugging in other source finders
5
+ License: BSD-3-Clause
6
+ Author: vla22
7
+ Author-email: vla22@cam.ac.uk
8
+ Requires-Python: >=3.12,<4.0
9
+ Classifier: License :: OSI Approved :: BSD License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: dask[complete] (>=2025.2.0,<2026.0.0)
14
+ Requires-Dist: distributed (>=2025.2.0,<2026.0.0)
15
+ Requires-Dist: fits2tmp (>=0.2.0,<0.3.0)
16
+ Description-Content-Type: text/markdown
17
+
18
+ # dasksf
19
+
20
+
21
+
22
+ ## Getting started
23
+
24
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
25
+
26
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
27
+
28
+ ## Add your files
29
+
30
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
31
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
32
+
33
+ ```
34
+ cd existing_repo
35
+ git remote add origin https://gitlab.developers.cam.ac.uk/phy/ra/vla22-phd/dasksf.git
36
+ git branch -M main
37
+ git push -uf origin main
38
+ ```
39
+
40
+ ## Integrate with your tools
41
+
42
+ - [ ] [Set up project integrations](https://gitlab.developers.cam.ac.uk/phy/ra/vla22-phd/dasksf/-/settings/integrations)
43
+
44
+ ## Collaborate with your team
45
+
46
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
47
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
48
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
49
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
50
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
51
+
52
+ ## Test and Deploy
53
+
54
+ Use the built-in continuous integration in GitLab.
55
+
56
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
57
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
58
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
59
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
60
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
61
+
62
+ ***
63
+
64
+ # Editing this README
65
+
66
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
67
+
68
+ ## Suggestions for a good README
69
+
70
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
71
+
72
+ ## Name
73
+ Choose a self-explaining name for your project.
74
+
75
+ ## Description
76
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
77
+
78
+ ## Badges
79
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
80
+
81
+ ## Visuals
82
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
83
+
84
+ ## Installation
85
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
86
+
87
+ ## Usage
88
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
89
+
90
+ ## Support
91
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
92
+
93
+ ## Roadmap
94
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
95
+
96
+ ## Contributing
97
+ State if you are open to contributions and what your requirements are for accepting them.
98
+
99
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
100
+
101
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
102
+
103
+ ## Authors and acknowledgment
104
+ Show your appreciation to those who have contributed to the project.
105
+
106
+ ## License
107
+ For open source projects, say how it is licensed.
108
+
109
+ ## Project status
110
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
111
+
dasksf-0.1.0/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # dasksf
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
+
9
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
+
11
+ ## Add your files
12
+
13
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
15
+
16
+ ```
17
+ cd existing_repo
18
+ git remote add origin https://gitlab.developers.cam.ac.uk/phy/ra/vla22-phd/dasksf.git
19
+ git branch -M main
20
+ git push -uf origin main
21
+ ```
22
+
23
+ ## Integrate with your tools
24
+
25
+ - [ ] [Set up project integrations](https://gitlab.developers.cam.ac.uk/phy/ra/vla22-phd/dasksf/-/settings/integrations)
26
+
27
+ ## Collaborate with your team
28
+
29
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34
+
35
+ ## Test and Deploy
36
+
37
+ Use the built-in continuous integration in GitLab.
38
+
39
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
+
45
+ ***
46
+
47
+ # Editing this README
48
+
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
+
51
+ ## Suggestions for a good README
52
+
53
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54
+
55
+ ## Name
56
+ Choose a self-explaining name for your project.
57
+
58
+ ## Description
59
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
+
61
+ ## Badges
62
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63
+
64
+ ## Visuals
65
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66
+
67
+ ## Installation
68
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69
+
70
+ ## Usage
71
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72
+
73
+ ## Support
74
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
+
76
+ ## Roadmap
77
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
78
+
79
+ ## Contributing
80
+ State if you are open to contributions and what your requirements are for accepting them.
81
+
82
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
83
+
84
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
85
+
86
+ ## Authors and acknowledgment
87
+ Show your appreciation to those who have contributed to the project.
88
+
89
+ ## License
90
+ For open source projects, say how it is licensed.
91
+
92
+ ## Project status
93
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,24 @@
1
+
2
+ [project]
3
+ name = "dasksf"
4
+ version = "0.1.0"
5
+ description = "Radio astronomy source finding using dask and plugging in other source finders"
6
+ authors = [
7
+ { name ="vla22", email= "vla22@cam.ac.uk"},
8
+ ]
9
+ license = "BSD-3-Clause"
10
+ readme = "README.md"
11
+ repository = "https://gitlab.developers.cam.ac.uk/phy/ra/vla22-phd/dasksf"
12
+
13
+ [tool.poetry.dependencies]
14
+ python = "^3.12"
15
+ dask = {extras = ["complete"], version = "^2025.2.0"}
16
+ distributed = "^2025.2.0"
17
+ fits2tmp = "^0.2.0"
18
+
19
+ [project.scripts]
20
+ def_cluster = "dasksf.def_cluster:app"
21
+
22
+ [build-system]
23
+ requires = ["poetry-core"]
24
+ build-backend = "poetry.core.masonry.api"
@@ -0,0 +1 @@
1
+ __all__ = ["def_cluster", "mypipe"]
@@ -0,0 +1,66 @@
1
+ import subprocess
2
+ import dask
3
+ import logging
4
+ import configparser
5
+ import argparse
6
+ import mypipe
7
+ from distributed import Client, LocalCluster
8
+
9
+ class ClusterD():
10
+ """
11
+ Collects the definition of the Dask cluster that is running, or if there is not a cluster running, creates a local cluster."
12
+ """
13
+ def __init__(self, config_read="../../config/config.ini"):
14
+ # params can be passed on the command line, to override defaults
15
+ config = configparser.ConfigParser()
16
+ config.read(config_read)
17
+ parser = argparse.ArgumentParser()
18
+ parser.add_argument("--platform", help="specify the platform on which you are running this code", default=config['DEFAULT']['platform'])
19
+ parser.add_argument("--workflow", help="specify the workflow used", default=config['DEFAULT']['workflow'])
20
+ parser.add_argument("--n_nodes", help="number of nodes", default=config['DEFAULT']['n_nodes'], type=int)
21
+ parser.add_argument("--n_workers", help="number of workers", default=config['DEFAULT']['n_workers'], type=int)
22
+ parser.add_argument("--worker_mem", help="RAM per worker", default=config['DEFAULT']['worker_mem'])
23
+ parser.add_argument("--n_threads", help="threads per worker", default=config['DEFAULT']['n_threads'], type=int)
24
+ parser.add_argument("--scheduler", help="dask scheduler")
25
+ parser.add_argument("--image_config", help="tell us about the dataset to use, based on the config file", default="image-default")
26
+ args = parser.parse_args()
27
+ platform = args.platform
28
+ workflow = args.workflow
29
+ n_nodes = args.n_nodes
30
+ n_workers = args.n_workers
31
+ worker_mem = args.worker_mem[:-3]
32
+ n_threads = args.n_threads
33
+ image_config = args.image_config
34
+ data = config[platform]['data']
35
+ header_loc = config[platform]['header_loc']
36
+ tmpdir = config[platform]['tmpdir']
37
+ outputdir = config[platform]['outputdir']
38
+ sofia_params = config[platform]['sofia_params']
39
+ n_dims = config[image_config]['n_dims']
40
+ im_shape = config[image_config]['im_shape']
41
+ chunk_size = config[image_config]['chunk_size']
42
+ logging.basicConfig(filename=config[platform]['outputdir']+"cluster.log", level=logging.INFO,format="%(asctime)s p%(process)s {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
43
+ if config['DEFAULT']['csd3'] == "True":
44
+ # This is for connecting to a client on a self-defined cluster, using a local variable to connect to the scheduler
45
+ scheduler = args.scheduler
46
+ client = Client(scheduler)
47
+ logging.info("client connected")
48
+ logging.info(client.scheduler_info())
49
+ a = mypipe.Pipeline(client=client, n_nodes=n_nodes, n_workers=n_workers, n_threads=n_threads, worker_mem=worker_mem, platform=platform, workflow=workflow, outputdir=outputdir, data=data, header_loc=header_loc, tmpdir=tmpdir, sofia_params=sofia_params, n_dims=n_dims, im_shape=im_shape, chunk_size=chunk_size)
50
+ a.run_sofia_pipeline()
51
+ elif config['DEFAULT']['k8s'] == "True":
52
+ # we use a bare client. If in a k8s environment, the config should connect to the scheduler automatically; otherwise it should fall back to a LocalCluster, suitable for local/single node testing.
53
+ client = Client()
54
+ a = mypipe.Pipeline(client=client, worker_mem=worker_mem, n_threads=n_threads, n_workers=n_workers, n_nodes=n_nodes, platform=platform, workflow=workflow, outputdir=outputdir, data=data, header_loc=header_loc, tmpdir=tmpdir, sofia_params=sofia_params, n_dims=n_dims, im_shape=im_shape, chunk_size=chunk_size)
55
+ a.run_sofia_pipeline()
56
+ else:
57
+ with LocalCluster(threads_per_worker=n_threads, n_workers=n_workers, memory_limit=(worker_mem + "GB")) as cluster, Client(cluster) as client:
58
+
59
+ # we configure a local cluster
60
+ a = mypipe.Pipeline(client=client, worker_mem=worker_mem, n_threads=n_threads, n_workers=n_workers, n_nodes=n_nodes, platform=platform, workflow=workflow, outputdir=outputdir, data=data, header_loc=header_loc, tmpdir=tmpdir, sofia_params=sofia_params, n_dims=n_dims, im_shape=im_shape, chunk_size=chunk_size)
61
+ a.run_sofia_pipeline()
62
+
63
+ if __name__ == "__main__":
64
+ a = ClusterD()
65
+
66
+
@@ -0,0 +1,105 @@
1
+ import fits2tmp as f2t
2
+ import subprocess
3
+ import configparser
4
+ import logging
5
+ import time
6
+ from dask.distributed import performance_report, get_task_stream
7
+ from dask import delayed
8
+ from dask.diagnostics import Profiler, ResourceProfiler, CacheProfiler, visualize
9
+ from datetime import timedelta
10
+
11
+ class Pipeline:
12
+ def __init__(self, client, n_nodes, n_workers, n_threads, worker_mem, platform, workflow, outputdir, data, header_loc, tmpdir, sofia_params, n_dims, im_shape, chunk_size):
13
+ # TODO get dask version, fits2tmp version and dasksf version and log
14
+ self.client = client
15
+ self.nodes = n_nodes
16
+ self.n_workers = n_workers
17
+ self.n_threads = n_threads
18
+ self.platform = platform
19
+ self.worker_mem = int(worker_mem)
20
+ #self.dask_version = subprocess.run(["dask", "--version"])
21
+ # create a config reader to allow us to provide values to the program
22
+ self.n_dims = n_dims
23
+ self.outputdir = outputdir
24
+ self.workflow = workflow
25
+ self.data = data
26
+ self.header_loc = header_loc
27
+ self.tmpdir = tmpdir
28
+ self.sofia_params = sofia_params
29
+ self.im_shape = [int(x) for x in im_shape.split(",")]
30
+ self.im_as_slice = []
31
+ for i in range(len(self.im_shape)):
32
+ self.im_as_slice.append(slice(0, self.im_shape[i]))
33
+ self.im_pix = 1
34
+ for i in range(int(self.n_dims)):
35
+ self.im_pix = self.im_shape[i] * self.im_pix
36
+ self.chunk_info = chunk_size
37
+ if self.chunk_info != "auto":
38
+ self.chunks = tuple([int(x) for x in self.chunk_info.split(",")])
39
+ self.ch_pix = 1
40
+ for i in range(int(self.n_dims)):
41
+ self.ch_pix = self.chunks[i] * self.im_pix
42
+ else:
43
+ self.chunks = self.chunk_info
44
+ self.ch_pix = "auto"
45
+ if "fits" in self.data:
46
+ self.filetype = "fits"
47
+ elif "zarr" in self.data:
48
+ self.filetype = "zarr"
49
+ elif "h5" in self.data:
50
+ self.filetype = "hdf5"
51
+ standard_formatter = logging.Formatter("%(asctime)s p%(process)s {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
52
+ output_formatter = logging.Formatter('%(asctime)s %(message)s', datefmt="%Y-%m-%d %H:%M:%S")
53
+ standard_handler = logging.FileHandler(self.outputdir + "dsf.log")
54
+ output_handler = logging.FileHandler(self.outputdir + "timings.csv")
55
+ standard_handler.setFormatter(standard_formatter)
56
+ output_handler.setFormatter(output_formatter)
57
+ self.mainlog = logging.getLogger("mainlog")
58
+ self.mainlog.setLevel("INFO")
59
+ self.mainlog.addHandler(standard_handler)
60
+ self.outputlog = logging.getLogger("outputlog")
61
+ self.outputlog.setLevel("INFO")
62
+ self.outputlog.addHandler(output_handler)
63
+
64
+ def run_sof(self, filename):
65
+ subprocess.run(["sofia", self.sofia_params, "input.data="+filename, "output.directory="+self.outputdir])
66
+
67
+ def run_sofia_pipeline(self):
68
+ client = self.client
69
+ start_time = time.monotonic()
70
+ #print(type(self.data), type(self.tmpdir), self.chunks)
71
+ with performance_report(filename="perf_report.html"), Profiler() as prof, ResourceProfiler(dt=0.05) as rprof, CacheProfiler() as cprof, get_task_stream(plot="save", filename=("task_stream.html")) as ts:
72
+ filelist = f2t.fits2tmp.fakefits2tmpfiles(self.filetype, self.data, self.tmpdir, self.header_loc, tuple(self.im_as_slice), self.chunks)
73
+ print(filelist)
74
+ scatter_files = client.scatter(filelist)
75
+ load_time = time.monotonic()
76
+ outlist = []
77
+ for i in filelist:
78
+ a = self.run_sof(i)
79
+ outlist.append(i[i.index('/'):])
80
+ calc_done = time.monotonic()
81
+ output = client.gather(outlist)
82
+ end_time = time.monotonic()
83
+ print(outlist)
84
+ self.outputlog.info(
85
+ ", %s, %s,%s, %s, %s, %s, %s, %s, %s,%s, %s, %s, %s, %s",
86
+ #%s, %s, %s",
87
+ str(self.platform),
88
+ ##str(self.dask_version),
89
+ str(self.workflow),
90
+ str(self.nodes),
91
+ str(self.n_workers),
92
+ str(self.n_threads),
93
+ str(self.worker_mem),
94
+ self.n_dims,
95
+ self.im_pix,
96
+ self.ch_pix,
97
+ self.filetype,
98
+ str(timedelta(seconds = calc_done - start_time)),
99
+ str(timedelta(seconds = load_time - start_time)),
100
+ str(timedelta(seconds = calc_done - load_time)),
101
+ timedelta(seconds = end_time - calc_done),
102
+ #mem_used,
103
+ )
104
+ visualize([prof, rprof, cprof], filename=(self.outputdir + "profile.html"), save=True)
105
+