Skip to content

Monthly Flarelists#458

Open
nicHoch wants to merge 5 commits intoi4Ds:masterfrom
nicHoch:flarelist
Open

Monthly Flarelists#458
nicHoch wants to merge 5 commits intoi4Ds:masterfrom
nicHoch:flarelist

Conversation

@nicHoch
Copy link
Collaborator

@nicHoch nicHoch commented Mar 23, 2026

No description provided.

"""Hook called after reading data from FITS. Mixins override and chain via super()."""
s = super()
if hasattr(s, "on_deserialize"):
s.on_deserialize(data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hum this is a bit of code smell - it's breaking the inheritance pattern - I'd suggestion implement on the base case and either pass or raise not implemented error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i implemented a hopefully more pythonic flow

nicHoch added 3 commits March 23, 2026 15:09
Fits de/serialize hook for converting into fits serializeable icrs frame
@codecov-commenter
Copy link

codecov-commenter commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 31.81818% with 165 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.28%. Comparing base (3ae9671) to head (4bbc2e8).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
stixcore/products/level3/flarelist.py 27.48% 95 Missing ⚠️
stixcore/products/level3/processing.py 24.13% 44 Missing ⚠️
stixcore/processing/pipeline_daily.py 23.52% 13 Missing ⚠️
stixcore/io/FlareListManager.py 14.28% 6 Missing ⚠️
stixcore/products/level3/flarelistproduct.py 57.14% 3 Missing ⚠️
stixcore/io/product_processors/fits/processors.py 71.42% 2 Missing ⚠️
stixcore/processing/FLtoFL.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #458      +/-   ##
==========================================
- Coverage   72.23%   67.28%   -4.95%     
==========================================
  Files          78       80       +2     
  Lines        8085     9023     +938     
==========================================
+ Hits         5840     6071     +231     
- Misses       2245     2952     +707     

☔ 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 still need to check the code out and run it as hard to fully understand from just reading but looks good, left a few minor comments.

return table_hdu


def CreateUtcColumn(table, data, colname, description="UTC Time"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

snake case

Suggested change
def CreateUtcColumn(table, data, colname, description="UTC Time"):
def create_utc_column(table, data, colname, description="UTC Time"):

or maybe create_UTC_column not sure what the PEP says for this?

Comment on lines +192 to +197
CreateUtcColumn(
data,
[Time(d, format="isot", scale="utc") for d in mt["start_UTC"]],
"start_UTC",
description="start time of flare",
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

data.add_column(Column([Time(d, format="isot", scale="utc") for d in mt["start_UTC"]], name="start_UTC",description="start time of flare")

not sure if the function is need id honest really do much?

return kwargs["level"] == "L3" and service_type == 0 and service_subtype == 0 and ssid == 8


def longest_constant_sequence(state_array):
Copy link
Collaborator

Choose a reason for hiding this comment

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

test for this would be good

return max_length, max_start_idx, max_state


def calculate_overlap(range1, range2):
Copy link
Collaborator

Choose a reason for hiding this comment

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

test for this would be good

# do the calculations with stixpy
try:
stixpy_cpd = STIXPYProduct(Path(data[i]["cpd_path"]))
time_range = TimeRange(max(peak_time - 20 * u.s, start_time), min(peak_time + 20 * u.s, end_time))
Copy link
Collaborator

Choose a reason for hiding this comment

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

why the min / max?

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