diff --git a/docker-compose.yml b/docker-compose.yml index 1716ad6..fcea7f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,10 @@ services: dockerfile: Dockerfile ports: # Modify port as needed + # Jupyter runs on 8888 - "8888:8888" + # Ray dashboard runs on 8265 + - "8265:8265" environment: - JUPYTER_TOKEN=letmein volumes: diff --git a/gammapy_tools/make_background/background_models.py b/gammapy_tools/make_background/background_models.py index 0d7afd8..3553943 100644 --- a/gammapy_tools/make_background/background_models.py +++ b/gammapy_tools/make_background/background_models.py @@ -2,7 +2,9 @@ import numpy as np from scipy.ndimage import gaussian_filter -from multiprocess import Pool +# from multiprocess import Pool +import ray +from ray import Pool # Astropy stuff @@ -51,7 +53,8 @@ def __init__( None """ - + + ray.init() self.njobs = njobs self.counts = self._make_bkg2d(energy, offset, unit="") self.exposure = self._make_bkg2d(energy, offset, unit="s TeV sr") diff --git a/pyproject.toml b/pyproject.toml index 6f40159..cc11243 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ dependencies = [ "PyYAML", "regions", "tqdm", + "ray[default]", ] [project.optional-dependencies]