Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • N NIFTy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

On Monday, June 12, 2023, from 9.00 to 10.00 am there will be a maintenance with a short downtime of the GitLab service.

  • ift
  • NIFTy
  • Merge requests
  • !437

Even more elegant random numbers?

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Martin Reinecke requested to merge randomcontext into NIFTy_6 Apr 01, 2020
  • Overview 9
  • Commits 4
  • Pipelines 4
  • Changes 10

Having to manually push and pop SeedSequences to the internal stack of the random module promises to be a bit error-prone, because it's easy to forget the pop operation.

What do you think about using a context manager like I'm demonstrating in a few cases in test_random.py? If you like it, I'll use the new construct in all places where it's appropriate.

@parras, @gedenhof

Edited Apr 01, 2020 by Martin Reinecke
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: randomcontext