Skip to content

ADD: STR unit tests - #70

Open
Mr-Msf wants to merge 7 commits into
virtual-sensorsfrom
dev/STR_unit_tests
Open

ADD: STR unit tests#70
Mr-Msf wants to merge 7 commits into
virtual-sensorsfrom
dev/STR_unit_tests

Conversation

@Mr-Msf

@Mr-Msf Mr-Msf commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

This PR will add unit tests for the STR class to the virtual-sensors branch. Note that the tests' functionality is dependent on the CHG: Adding sensor eclipse and body detection PR being closed.

@Mr-Msf Mr-Msf linked an issue Jul 30, 2026 that may be closed by this pull request
@Mr-Msf
Mr-Msf requested a review from wlodaralex July 30, 2026 15:41
Comment thread tests/test_str.py Outdated

STR_CFG = Path("../hardware/sensors/icd/str/sagitta.json")

RAD_SUN = 695700000.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would be good to centralize these constants somewhere because they can end up being used in multiple places and we might end up with conflicts (e.g. Earth equatorial radius vs polar radius).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Functionality added (in PR #55).

Comment thread test_STR.py Outdated
Comment thread test_STR.py Outdated
assert str.rate_hz == pytest.approx(10.0)
assert str.cov_rad2.shape == (3, 3)

def get_cone_edge_angles(str, q, body_start, body_end, body_name, step_num):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's really not clear to me what this function is doing. Please add comments (including docstrings, preferably) so that it's easier to follow.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You might have been looking at the first version of test_STR.py I committed, as recent versions have docstrings for all functions.

Comment thread tests/test_str.py Outdated
Comment thread tests/test_str.py Outdated
Comment thread tests/test_str.py Outdated
@Mr-Msf
Mr-Msf requested a review from wlodaralex August 7, 2026 17:49
@Mr-Msf

Mr-Msf commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

This PR should be ready for re-review (note that functionality is dependent on PR #55). When merged, ensure that only test_STR.py is modified by this PR.

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.

SENSORS branch - STR unit tests

2 participants