File tree 4 files changed +15
-7
lines changed
4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 39
39
codecov
40
40
- uses : ammaraskar/sphinx-action@master
41
41
with :
42
- pre-build-command : " pip install -r requirements.txt && pip install . && pip install sphinx myst-parser && pip install sphinxcontrib-gtagjs ipython numpydoc sphinx-tabs sphinx_rtd_theme nbsphinx ipython pydata-sphinx-theme nbsphinx-link sphinx-panels"
42
+ pre-build-command : " pip install -r requirements.txt && pip install . && pip install -U sphinx myst-parser && pip install sphinxcontrib-gtagjs ipython numpydoc sphinx-tabs sphinx_rtd_theme nbsphinx ipython pydata-sphinx-theme nbsphinx-link sphinx-panels"
43
43
docs-folder : " docs/"
Original file line number Diff line number Diff line change @@ -108,3 +108,5 @@ venv.bak/
108
108
.mypy_cache /
109
109
* .sqlite
110
110
* .sqlite.gz
111
+
112
+ geoweb_downloads /
Original file line number Diff line number Diff line change @@ -1660,6 +1660,7 @@ def _format_request(self):
1660
1660
return payload
1661
1661
1662
1662
def search (self ):
1663
+ """Sends the user query via requests to SRA, GEO DataSets, or both"""
1663
1664
if not self .search_geo :
1664
1665
super ().search ()
1665
1666
else :
@@ -1679,7 +1680,7 @@ def search(self):
1679
1680
elink_payload = {
1680
1681
"dbfrom" : "gds" ,
1681
1682
"db" : "sra" ,
1682
- "retmode" : "json " ,
1683
+ "retmode" : "xml " ,
1683
1684
"query_key" : query_key ,
1684
1685
"WebEnv" : web_env ,
1685
1686
}
@@ -1690,9 +1691,12 @@ def search(self):
1690
1691
)
1691
1692
r .raise_for_status ()
1692
1693
try :
1693
- data = r .json ()
1694
- uids_from_geo = data ["linksets" ][0 ]["linksetdbs" ][0 ]["links" ]
1695
- except (JSONDecodeError , KeyError , IndexError ):
1694
+ root = Et .fromstring (r .text )
1695
+ uids_from_geo = [
1696
+ elem .text
1697
+ for elem in root .findall (".//LinkSet/LinkSetDb/Link/Id" )
1698
+ ]
1699
+ except (Et .ParseError , TypeError , ValueError ):
1696
1700
uids_from_geo = []
1697
1701
# Step 2: Retrieve list of uids from SRA and
1698
1702
# Find the intersection of both lists of uids
Original file line number Diff line number Diff line change @@ -1179,8 +1179,10 @@ def test_geo_search_1():
1179
1179
instance = GeoSearch (3 , 1000 , geo_query = "human" )
1180
1180
instance .search ()
1181
1181
df = instance .get_df ()
1182
- df = instance .get_df ()["experiment_accession" ].to_list ()
1183
- assert len (df ) > 10
1182
+ assert not df .empty
1183
+
1184
+ experiment_accessions = instance .get_df ()["experiment_accession" ].to_list ()
1185
+ assert len (experiment_accessions ) > 10
1184
1186
# with open("./tests/data/test_search/geo_search_test1.txt", "r") as f:
1185
1187
# expected_accessions = f.read().splitlines()
1186
1188
You can’t perform that action at this time.
0 commit comments