llnl / llnl/SSAPy

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

Open Beginner friendly
#137 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.