miniff issueshttps://gitlab.kwant-project.org/qt/miniff/-/issues2020-12-22T12:57:32Zhttps://gitlab.kwant-project.org/qt/miniff/-/issues/12Fix randomly failing tests2020-12-22T12:57:32ZArtem PulkinFix randomly failing testsA number of tests fail randomly (TODOs in the code). Fix them by setting the random seed.A number of tests fail randomly (TODOs in the code). Fix them by setting the random seed.https://gitlab.kwant-project.org/qt/miniff/-/issues/6test_serialization_state_norm failed during test run on Ubuntu 20.042021-01-05T09:00:52ZNiket Agrawaltest_serialization_state_norm failed during test run on Ubuntu 20.04Environment details: <br/>
Ubuntu 20.04.1 LTS (Windows subsystem for Linux) <br/>
Miniconda 4.8.3 <br/>
Python 3.8.5 <br/>
Steps to reproduce:
1. Create conda environment <br/>
`conda create -n <my-env> python=3.8` <br/>
Replace `<my-e...Environment details: <br/>
Ubuntu 20.04.1 LTS (Windows subsystem for Linux) <br/>
Miniconda 4.8.3 <br/>
Python 3.8.5 <br/>
Steps to reproduce:
1. Create conda environment <br/>
`conda create -n <my-env> python=3.8` <br/>
Replace `<my-env>` with desired environment name.
2. Activate the conda environment <br/>
`conda activate <my-env>`
3. Install dependencies as mentioned in README.
numpy: `conda install numpy` <br/>
scipy: `conda install scipy` <br/>
Pytorch: `conda install pytorch torchvision cpuonly -c pytorch` <br/>
Above command for pytorch installation is generated from https://pytorch.org/get-started/locally/ specific for a Linux + conda environment <br/>
numericalunits: `conda install -c conda-forge numericalunits` <br/>
matplotlib: `conda install matplotlib` <br/>
svgwrite: `conda install -c conda-forge svgwrite` <br/>
requests: `conda install requests` <br/>
nose: `conda install nose` <br/>
`pip3 install git+https://github.com/pulkin/dfttools.git#subdirectory=src`
4. Clone the miniff repository
5. Build and install
```
python3 setup.py build
python3 setup.py install
```
6. Rnun tests
```
python3 setup.py nosetests
```
Below is an excerpt of the output after executing the command `python setup.py nosetests`. The full terminal log is attached.
```
ERROR: test_serialization_state_norm (miniff.test_ml.LJBoxTestUnalignedTwoComponentCharges)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nagrawal/miniff/miniff/test_ml.py", line 588, in test_serialization_state_norm
ref = ml.NNPotential.from_state_dict(torch.load(f))
File "/home/nagrawal/miniconda3/envs/dressingupmlcode/lib/python3.8/site-packages/torch/serialization.py", line 577, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "/home/nagrawal/miniconda3/envs/dressingupmlcode/lib/python3.8/site-packages/torch/serialization.py", line 241, in __init__
super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: [enforce fail at inline_container.cc:144] . PytorchStreamReader failed reading zip archive: invalid header or archive is corrupted
```
[errorlog.log](/uploads/2c81d376c7a250babc97002c8ed6e78f/errorlog.log)https://gitlab.kwant-project.org/qt/miniff/-/issues/2Suggestion: switch to pytest2021-04-28T16:16:25ZAnton AkhmerovSuggestion: switch to pytestnose is unmaintained and recommends to use pytest insteadnose is unmaintained and recommends to use pytest instead