Material API: incorrect statistics count
The material API is reporting at least partially incorrect values in the statistics. Maybe it is sometimes counting entries instead of materials?
After investigating this a bit, it seems the problem happens when a material has more than one entry. So e.g. if you upload two entries that have the same material, you should end up with a material index with one material containing two entries. Then if you run a material aggregation e.g. to get the number of materials with method_name=DFT
(in the GUI you can just up open the "Method" filters and look at the statistics for DFT)
The problem can be reproduced e.g. by creating a material index which has one material with multiple entries. There is, however, a small problem caused by #608 (closed): Due to a race condition in the materials indexing, the indexing will sometimes drop one of the entries from the materials index. But you should be able to reproduce after uploading the attached file twice. Here are the exact steps:
- Start from the current v1.0.0 branch (206e1e82)
- Clean index, upload the attached test upload twice.
- After processing is complete, go to materials search, open the method panel, see statistics for
method_name
see the number of DFT entries, which says more than one, although there is only one material.