Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • kwant kwant
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 140
    • Issues 140
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • kwant
  • kwantkwant
  • Issues
  • #330
Closed
Open
Created Nov 13, 2019 by Joseph Weston@jbwestonOwner

be more systematic about use of random numbers within the tests

Kwant's test suite has flaky test failures. I do not believe that these failures are "bad" (i.e. they do not correspond to bugs in kwant) but they are not reproducible. I believe that this is because some of the tests rely on numpy's RNG, and we do not set the seed in a consistent way.

I know for a fact that some of the tests in kwant.tests.test_qsymm directly use numpy RNG, but even if other tests do not explicitly use it, the numpy RNG is sometimes used inconspicuously (e.g. during sparse diagonalization to choose the initial vector).

My proposal is to simply enable pytest-randomly in CI, so that at least the CI tests are reproducible.

If we also want people to be able to run the tests in a reproducible way on their own computers then we should also make pytest-randomly a testing dependency

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking