Coverage for /builds/ase/ase/ase/io/nomad_json.py: 87.50%

8 statements  

« prev     ^ index     » next       coverage.py v7.5.3, created at 2025-08-02 00:12 +0000

1# fmt: off 

2 

3from ase.nomad import read as _read_nomad_json 

4 

5 

6def read_nomad_json(fd, index): 

7 # wth, we should not be passing index like this! 

8 from ase.io.formats import string2index 

9 if isinstance(index, str): 

10 index = string2index(index) 

11 

12 d = _read_nomad_json(fd) 

13 images = list(d.iterimages()) 

14 return images[index]