Atlas-Download-Tools icon indicating copy to clipboard operation
Atlas-Download-Tools copied to clipboard

Some RMA queries never return all results

Open Stannislav opened this issue 3 years ago • 0 comments

The following code snippet sends a particular RMA query, for which the number of results returned by the server is always consistently smaller than the total number of results reported in the status part of the reponse:

from atldld.requests import RMAParameters, rma_all

rma_parameters = RMAParameters(
    "SectionDataSet",
    criteria={
        "specimen": {"donor": {"age": {"days": 56}}},
        "probes": {"orientation": {"name": "Antisense"}}
    },
)

msg = rma_all(rma_parameters)
  • Number of results reported: 50476
  • Number of results received: 50274

This leads to rma_all raising a RuntimeError:

Downloading the metadata for all results...
Traceback (most recent call last):
  File "/Users/sschmidt/Code/BlueBrain/atldld/x.py", line 17, in <module>
    msg = rma_all(rma_parameters)
  File "/Users/sschmidt/Code/BlueBrain/atldld/src/atldld/requests.py", line 187, in rma_all
    raise RuntimeError("No data received")
RuntimeError: No data received

Given that the behaviour of not returning all results reported is reproducible we should probably not raise but only print a warning and still return the results received.

Stannislav avatar Dec 10 '21 16:12 Stannislav