https://github.com/aevtikheev/flake8-numpy-random
Plugin for Flake8 that forbids the usage of numpy.random()
https://github.com/aevtikheev/flake8-numpy-random
flake8 flake8-plugin linter python
Last synced: about 2 months ago
JSON representation
Plugin for Flake8 that forbids the usage of numpy.random()
- Host: GitHub
- URL: https://github.com/aevtikheev/flake8-numpy-random
- Owner: aevtikheev
- License: mit
- Created: 2021-04-11T19:55:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-12T12:19:33.000Z (almost 5 years ago)
- Last Synced: 2025-09-22T15:10:36.518Z (6 months ago)
- Topics: flake8, flake8-plugin, linter, python
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flake8-numpy-random
Plugin for Flake8 that forbids usage of numpy.random()
## Installation
```bash
pip install flake8-numpy-random
```
## Motivation
Using NumPy’s random number generator with multi-process data loading in PyTorch causes identical augmentations unless you specifically set seeds using the worker_init_fn option in the DataLoader. Details - https://tanelp.github.io/posts/a-bug-that-plagues-thousands-of-open-source-ml-projects/
## Error codes
| Error code | Description |
|:----------:|:-------------------------:|
| NPR001 | do not use numpy.random() |
## License
MIT