From 6672642728d01d7885c2117d3e991b223d84af4d Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Fri, 31 Oct 2025 15:14:52 -0400 Subject: [PATCH 1/2] Make `MSID.content` into a property to prevent unnecessary remote access --- cheta/fetch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cheta/fetch.py b/cheta/fetch.py index fde4c1a6..807150ea 100644 --- a/cheta/fetch.py +++ b/cheta/fetch.py @@ -511,7 +511,6 @@ def __init__(self, msid, start=LAUNCH_DATE, stop=None, filter_bad=False, stat=No self.datestart = DateTime(self.tstart).date self.datestop = DateTime(self.tstop).date self.data_source = {} - self.content = content.get(self.MSID) if self.datestart < DATE2000_LO and self.datestop > DATE2000_HI: intervals = [(self.datestart, DATE2000_HI), (DATE2000_HI, self.datestop)] @@ -529,6 +528,10 @@ def __init__(self, msid, start=LAUNCH_DATE, stop=None, filter_bad=False, stat=No if "CHETA_FETCH_DATA_GAP" in os.environ: create_msid_data_gap(self, os.environ["CHETA_FETCH_DATA_GAP"]) + @property + def content(self): + return content.get(self.MSID) + def __len__(self): return len(self.vals) From 99fb3dd93156d319053a14e7213b349d04011c8e Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Fri, 31 Oct 2025 15:32:19 -0400 Subject: [PATCH 2/2] Condition content on 'cxc' being in data sources --- cheta/fetch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cheta/fetch.py b/cheta/fetch.py index 807150ea..dffffe81 100644 --- a/cheta/fetch.py +++ b/cheta/fetch.py @@ -529,8 +529,8 @@ def __init__(self, msid, start=LAUNCH_DATE, stop=None, filter_bad=False, stat=No create_msid_data_gap(self, os.environ["CHETA_FETCH_DATA_GAP"]) @property - def content(self): - return content.get(self.MSID) + def content(self) -> str | None: + return content.get(self.MSID) if "cxc" in data_source.sources() else None def __len__(self): return len(self.vals)