Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor code smells #266

Merged
merged 1 commit into from
Feb 8, 2024
Merged

Fix minor code smells #266

merged 1 commit into from
Feb 8, 2024

Conversation

lkeegan
Copy link
Member

@lkeegan lkeegan commented Feb 8, 2024

  • use pytest.approx for floating point comparisons
  • replace legacy np.random.randint with rng.integers

@@ -63,7 +63,8 @@


def make_timestamps(t0: float, n_min: int = 8, n_max: int = 20) -> np.ndarray:
return np.linspace(t0, t0 + 1.0, np.random.randint(n_min, n_max))
rng = np.random.default_rng()

Check notice

Code scanning / SonarCloud

Results that depend on random number generation should be reproducible

<!--SONAR_ISSUE_KEY:AY2JDl_S_nr7s9RAPGuZ-->Provide a seed for this random generator. <p>See more on <a href="https://sonarcloud.io/project/issues?id=ssciwr_vstt&issues=AY2JDl_S_nr7s9RAPGuZ&open=AY2JDl_S_nr7s9RAPGuZ&pullRequest=266">SonarCloud</a></p>
- use pytest.approx for floating point comparisons
- replace legacy np.random.randint with rng.integers
- update codecov action
Copy link

sonarqubecloud bot commented Feb 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@lkeegan lkeegan merged commit 9f45260 into main Feb 8, 2024
15 checks passed
@lkeegan lkeegan deleted the code_smells branch February 8, 2024 14:43
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.

1 participant