abagen
abagen copied to clipboard
Bug with tests/mouse/test_gene.py
the test on tests/mouse/test_gene.py
could fail when retrieving the GENE data with a list contains 17943
The original test fails on the 36th run with the current random seed.
the fail happens on the second assertion
names = gene.get_gene_info(acronym=samples['acronym'], attributes='name')
assert sorted(names['name']) == sorted(samples['name'])
when the names are retrieved with "acronym": "9130019P16Rik"
the record from https://api.brain-map.org/api/v2/data/Gene/query.json
gets 2 records back instead of one
here is the URL generated by your program with only "acronym": "9130019P16Rik"
:
https://api.brain-map.org/api/v2/data/Gene/query.json?criteria=%5Bacronym%24in%279130019P16Rik%27%5D%2Cproducts%5Bid%24eq1%5D&only=name%2Cacronym&
here is the response of from the website of that URL:
{"success": true, "id": 0, "start_row": 0, "num_rows": 2, "total_rows": 2, "msg": [{"acronym":"9130019P16Rik","name":"RIKEN cDNA 9130019P16 gene"},{"acronym":"9130019P16Rik","name":"RIKEN cDNA 9130019P16 gene"}]}
The full record from the website is the following:
it seems like the server has two different records with the key "9130019P16Rik" on the column acronym that causing this problem and it is not your code that causes this bug.
I propose the following:
- do you want to report to the server about this issue
- do you want to change your code to detect/remove the duplicate result