Skip to content

Avoid torch seeding in non-RL simulations (+ minor general typos + default example fixed)#815

Open
mthede wants to merge 3 commits into
mainfrom
fixes_seeding_and_docs
Open

Avoid torch seeding in non-RL simulations (+ minor general typos + default example fixed)#815
mthede wants to merge 3 commits into
mainfrom
fixes_seeding_and_docs

Conversation

@mthede

@mthede mthede commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Skip torch seeding when torch is installed but not used: Irrelevant seeding was performed and a warning was thrown about deterministic PyTorch behavior, even though simulation does not use RL. This is fixed by only setting the PyTorch seeds when learning is active.
  • While at it, fixed the default example, some typos and minor rephrasing for clarity

Checklist

  • Documentation updated (docstrings, READMEs, user guides, inline comments, doc folder updates etc.)
  • New unit/integration tests added (if applicable)
  • Changes noted in release notes (if any)
  • Consent to release this PR's code under the GNU Affero General Public License v3.0

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.99%. Comparing base (6f2857a) to head (15a7397).

Files with missing lines Patch % Lines
assume/common/utils.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #815      +/-   ##
==========================================
- Coverage   82.09%   81.99%   -0.11%     
==========================================
  Files          56       56              
  Lines        9081     9085       +4     
==========================================
- Hits         7455     7449       -6     
- Misses       1626     1636      +10     
Flag Coverage Δ
pytest 81.99% <75.00%> (-0.11%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mthede mthede requested review from kim-mskw and maurerle June 3, 2026 12:50

@reinecfi reinecfi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks reasonable for me. Not sure why the tests fail.

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.

2 participants