Skip to content

Conversation

@nicHoch
Copy link
Collaborator

@nicHoch nicHoch commented Dec 5, 2025

No description provided.

@nicHoch nicHoch requested a review from samaloney December 5, 2025 12:34
@nicHoch nicHoch self-assigned this Dec 5, 2025
@nicHoch nicHoch added this to the v1.7.0 milestone Dec 5, 2025
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.08%. Comparing base (3ae9671) to head (33b19a4).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
stixcore/products/product.py 86.36% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #447      +/-   ##
==========================================
- Coverage   72.23%   69.08%   -3.15%     
==========================================
  Files          78       76       -2     
  Lines        8085     8136      +51     
==========================================
- Hits         5840     5621     -219     
- Misses       2245     2515     +270     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@samaloney samaloney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure allowing operations in different time systems is a good idea. A product should either have time in OBT or UTC and the conversion should only be done once in the from_level0 or similar methods?

All products (>L0) will always have obt_timerange from products will have an utc_timerange but only if the time sys in header is UTC and not sure supporting on the fly conversion is a good idea because the spice kernel dependence.

This aren't blocker just thoughts

Comment on lines +195 to +199
assert p.exposure == p.data["timedel"].as_float().min().to_value("s")
assert p.max_exposure == p.data["timedel"].as_float().max().to_value("s")
else:
assert p.exposure == p.data["timedel"].min().to_value("s")
assert p.max_exposure == p.data["timedel"].max().to_value("s")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid asserts like this for use if and raise a specific exception

offset = SCETime.from_float(pri_header["OBT_BEG"] * u.s)
# select the time format based on available header keywords
offset = None
if "TIMESYS" in pri_header and pri_header["TIMESYS"] == "UTC":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if "TIMESYS" in pri_header and pri_header["TIMESYS"] == "UTC":
if pri_header.get("TIMESYS", "") == "UTC":

if "TIMESYS" in pri_header and pri_header["TIMESYS"] == "UTC":
try:
offset = Time(pri_header["DATE-OBS"])
except Exception:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very broad exception

if "timedel" in l1.data.colnames and isinstance(l1.data["timedel"], SCETimeDelta):
l1.data.replace_column(
"timedel",
l1.data["timedel"].as_float(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an int to start with?

self.history = kwargs.get("history", [])

@property
def scet_timerange(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this specific case we always have OBT-BEG and OBT-END so maybe this should use those?

return "counts"

@property
def exposure(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really call this min_exposure as I'd expect this to contain all the exposure times

Comment on lines +954 to +955
(self.data["time"][0] - self.data["timedel"][0] / 2).datetime,
(self.data["time"][-1] + self.data["timedel"][-1] / 2).datetime,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the .datetime really needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants