Skip to content

Accept array-like time inputs in rv - #138

Merged
SuperdoerTrav merged 1 commit into
llnl:mainfrom
sylvesterkaczmarek:fix/rv-list-time-inputs
Sep 19, 2026
Merged

SuperdoerTrav merged 1 commit into
llnl:mainfrom
sylvesterkaczmarek:fix/rv-list-time-inputs

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Summary

Accept normal Python list and tuple values for the documented array_like time argument in ssapy.compute.rv().

Problem

_countTime() leaves iterable inputs unchanged. rv() then passes them to HashableArrayContainer, which expects a NumPy array and accesses .flags.writeable. As a result, a Python list raises AttributeError before propagation.

Change

  • Convert non-scalar iterable time inputs to np.asarray() in _countTime().
  • Preserve the existing scalar squeezing behaviour.
  • Add regression coverage showing list and tuple inputs match ndarray results.

Validation

  • python3 -m compileall -q ssapy/compute.py tests/test_orbit.py
  • git diff --check

The local default Python environment does not have pytest installed, so the focused pytest case was not run locally.

Fixes #137

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (a895a5b) to head (2b3a58a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #138   +/-   ##
=======================================
  Coverage   97.39%   97.39%           
=======================================
  Files          17       17           
  Lines        5820     5821    +1     
=======================================
+ Hits         5668     5669    +1     
  Misses        152      152           
Flag Coverage Δ
unittests 97.39% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
ssapy/compute.py 94.81% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SuperdoerTrav
SuperdoerTrav merged commit 6af6000 into llnl:main Sep 19, 2026
5 checks passed
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Thank you for merging this. Really appreciated, and I’m glad to keep contributing to SSAPy.

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.

rv() rejects list time inputs despite documenting time as array_like

3 participants