rv() rejects list time inputs despite documenting time as array_like
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 75
- Forks
- 17
- Avg merge
- 1h 51m
- Merged PRs (30d)
- 4
Description
## Summary
`ssapy.compute.rv()` documents `time` as `array_like`, but passing a normal Python list of GPS-second values fails before propagation.
## Reproduction
```python
import numpy as np
from ssapy import Orbit
from ssapy.compute import rv
orbit = Orbit(
np.array([7000e3, 0.0, 0.0]),
np.array([0.0, 7500.0, 0.0]),
0.0,
)
rv(orbit, [0.0, 60.0, 120.0])
```
`_countTime()` leaves an iterable input unchanged. `rv()` then wraps it in `HashableArrayContainer`, whose constructor accesses `self.arr.flags.writeable`. A Python `list` has no `.flags` attribute, so this raises `AttributeError`.
## Expected behaviour
List and tuple inputs should be accepted as documented `array_like` time inputs and normalised to an ndarray before they are used as cache keys.
## Proposed change
- Normalise non-`Time` iterable time inputs to NumPy arrays in `_countTime()`.
- Preserve the existing scalar-squeezing behaviour.
- Add regression coverage for list and tuple time inputs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with `_countTime()` and follow how `rv()` passes time into `HashableArrayContainer`; the issue identifies the failing `.flags.writeable` access. Reproduce the list case, then check the existing scalar-squeezing behavior. Done means list and tuple GPS-second inputs work as documented and regression coverage verifies both forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100