Skip to content

Update powerbox#82

Open
DanielaBreitman wants to merge 6 commits intomainfrom
update_powerbox
Open

Update powerbox#82
DanielaBreitman wants to merge 6 commits intomainfrom
update_powerbox

Conversation

@DanielaBreitman
Copy link
Copy Markdown
Contributor

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.84%. Comparing base (219c932) to head (dfc771e).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/tuesday/core/summaries/powerspectra.py 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
- Coverage   85.27%   84.84%   -0.44%     
==========================================
  Files          12       12              
  Lines         781      772       -9     
  Branches      192      190       -2     
==========================================
- Hits          666      655      -11     
- Misses         50       51       +1     
- Partials       65       66       +1     
Flag Coverage Δ
unittests 84.84% <80.00%> (-0.44%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@DanielaBreitman
Copy link
Copy Markdown
Contributor Author

Now also fixes [#77], but no test for it yet.

Copy link
Copy Markdown
Member

@steven-murray steven-murray left a comment

Choose a reason for hiding this comment

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

Thanks @DanielaBreitman ! Just a few niggly comments.

k_weights_1d: Callable | None = ignore_zero_ki,
bin_ave: bool | None = True,
interp: bool | None = None,
interp: str | None = None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
interp: str | None = None,
interp: Literal['linear', 'nan-aware'] | None = None,

mu_min: float | None = None,
bin_ave: bool = True,
interp: bool | None = None,
interp: str | None = None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
interp: str | None = None,
interp: Literal['linear', 'nan-aware'] | None = None,

mu_min: float | None = None,
bin_ave: bool | None = True,
interp: bool | None = None,
interp: str | None = None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
interp: str | None = None,
interp: Literal['linear', 'nan-aware'] | None = None,

bins_kpar: int | un.Quantity | None = None,
log_kpar: bool | None = False,
interp_kpar: bool | None = False,
interp_kpar: str | None = None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this also be nan-aware? Docs don't mention so?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like the answer is no. In this case this should just be Literal['linear'] | None

)

final_nmodes = np.sqrt(kperp_grid**2 + kpar_grid**2)
final_nmodes = kperp_nmodes_grid * kpar_nmodes_grid
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we sure that this is the correct calculation? It smells wrong to me. At the very least, it should have a substantial comment above it, explaining the reasoning.

Comment on lines 782 to 790
ps,
kperp,
kpar,
nbins=16,
weights=1,
interp=False,
interp=None,
mu_min=None,
generator=None,
bin_ave=True,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be great if these were typed properly. Actually at this stage it might be useful to define the interp type (Literal['linear', 'nan-aware'] | None) separately as a new type.

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.

2 participants