Skip to content

Commit

Permalink
Remove dependency to sortedcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc Hermitte committed Sep 13, 2024
1 parent 892179e commit 192e627
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions eof/_select_orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import operator
from datetime import datetime, timedelta
from typing import List, Sequence
from sortedcontainers import SortedList

from .products import SentinelOrbit

Expand All @@ -29,7 +28,7 @@ def valid_orbits(
) -> List[SentinelOrbit]:
# Using a start margin of > 1 orbit so that the start of the orbit file will
# cover the ascending node crossing of the acquisition
candidates = SortedList([
candidates = sorted([
item
for item in data
if item.start_time <= (t0 - margin0) and item.stop_time >= (t1 + margin1)
Expand Down
5 changes: 2 additions & 3 deletions eof/tests/test_asf_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

import pytest
from sortedcontainers import SortedSet

from eof.asf_client import ASFClient
from eof.client import OrbitType
Expand Down Expand Up @@ -39,13 +38,13 @@ def test_asf_full_url_list(tmp_path, asfclient: ASFClient):
- we can request EOFs available on ASF servers
- the EOFs obtained are a superset (more up-to-date) that the baseline
"""
baseline_urls = SortedSet((eof.filename for eof in asfclient.get_full_eof_list(max_dt=MAX_DT)))
baseline_urls = set((eof.filename for eof in asfclient.get_full_eof_list(max_dt=MAX_DT)))

cache_dir = tmp_path / "sentineleof1"
cache_dir.mkdir()
remote_asfclient = ASFClient(cache_dir=cache_dir)

remote_urls = SortedSet((eof.filename for eof in remote_asfclient.get_full_eof_list(max_dt=MAX_DT)))
remote_urls = set((eof.filename for eof in remote_asfclient.get_full_eof_list(max_dt=MAX_DT)))
assert len(remote_urls) > 0
# Should be quick second time
assert len(remote_asfclient.get_full_eof_list(max_dt=MAX_DT))
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
click==6.7
python-dateutil==2.5.1
requests>=2.20.0
sortedcontainers>=2.4
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"requests",
"click",
"python-dateutil",
"sortedcontainers",
],
entry_points={
"console_scripts": [
Expand Down

0 comments on commit 192e627

Please sign in to comment.