Skip to content

Commit

Permalink
fix: avoid creating paths in PlotTransientLightCurves
Browse files Browse the repository at this point in the history
  • Loading branch information
jvansanten committed Feb 4, 2025
1 parent 4b7389e commit 284d10b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ampel/contrib/hu/t3/PlotTransientLightcurves.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import gzip
import io
import os
import tempfile
from collections.abc import Generator, Iterable
from contextlib import nullcontext
from typing import Any
Expand Down Expand Up @@ -392,15 +393,13 @@ def post_init(self) -> None:
os.makedirs(self.save_dir, exist_ok=True)
if self.image_cache_dir:
os.makedirs(self.image_cache_dir, exist_ok=True)
# Create temporary path if not set
if not self.pdf_path:
import tempfile

self.pdf_path = tempfile.mkstemp(".pdf", "candidates", self.save_dir)[1]

# Possibly create a slack client
if self.slack_channel and self.slack_token is not None:
self.webclient = WebClient(self.slack_token.get())
elif not self.pdf_path:
# Create temporary path if not set
self.pdf_path = tempfile.mkstemp(".pdf", "candidates", self.save_dir)[1]

def attributes_from_t2(
self,
Expand Down

0 comments on commit 284d10b

Please sign in to comment.