saketkc / pysradb

Package for fetching metadata and downloading data from SRA/ENA/GEO
https://saketkc.github.io/pysradb
BSD 3-Clause "New" or "Revised" License
307 stars 50 forks source link

[BUG] month & day swapped for publication_date? #145

Closed gfudenberg closed 2 years ago

gfudenberg commented 2 years ago

Thanks for the great tool!

I wonder if the month & date are swapped for the publication_date argument in SraSearch, since I find fewer entries with a date range from '01-01-2021:01-02-2021' vs '01-01-2021:02-01-2021'.

image

Note the function nevertheless throws an error for e.g. 29-01-2021

In [2]: pysradb.version Out[2]: '1.0.1'

saketkc commented 2 years ago

Thanks!

The input format is 'dd-mm-yyyy' which then gets converted to 'yyyy/mm/dd'. Internally, the logic looks correct, but the results indeed look incorrect. Any clues @bscrow?

bscrow commented 2 years ago

Thank you @gfudenberg for the bug report! You are right that the month and date fields have been swapped. On the SRA server, date format in the form of 02/01/2021 is interpreted as mm/dd/yyyy instead of dd/mm/yyyy, which I missed. This should be resolved in #146.

saketkc commented 2 years ago

Thanks @bscrow for the PR!

@gfudenberg, you should be able to clone from the master branch to test the fix, I will make a release in the coming weeks.