Skip to content

Commit

Permalink
[Cloud Deployment IIIa]: pre-PR for removal of unused helpers (#980)
Browse files Browse the repository at this point in the history
Co-authored-by: CodyCBakerPhD <[email protected]>
Co-authored-by: Heberto Mayorquin <[email protected]>
  • Loading branch information
3 people authored Aug 7, 2024
1 parent 29e3cb6 commit a970fd4
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 196 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/live-service-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ jobs:
- name: Install full requirements
run: pip install .[test,full]

- name: Run subset of tests that use S3 live services
run: pytest -rsx -n auto tests/test_minimal/test_tools/s3_tools.py
- name: Run subset of tests that use DANDI live services
run: pytest -rsx -n auto tests/test_minimal/test_tools/dandi_transfer_tools.py
- name: Run subset of tests that use Globus live services
Expand Down
4 changes: 0 additions & 4 deletions src/neuroconv/tools/data_transfers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
"""Collection of helper functions for assessing and performing automated data transfers."""

from ._aws import estimate_s3_conversion_cost
from ._dandi import automatic_dandi_upload
from ._globus import get_globus_dataset_content_sizes, transfer_globus_content
from ._helpers import estimate_total_conversion_runtime

__all__ = [
"estimate_s3_conversion_cost",
"automatic_dandi_upload",
"get_globus_dataset_content_sizes",
"transfer_globus_content",
"estimate_total_conversion_runtime",
]
32 changes: 0 additions & 32 deletions src/neuroconv/tools/data_transfers/_aws.py

This file was deleted.

29 changes: 0 additions & 29 deletions src/neuroconv/tools/data_transfers/_helpers.py

This file was deleted.

81 changes: 0 additions & 81 deletions tests/test_minimal/test_tools/globus_transfer_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

from neuroconv.tools import deploy_process
from neuroconv.tools.data_transfers import (
estimate_s3_conversion_cost,
estimate_total_conversion_runtime,
get_globus_dataset_content_sizes,
transfer_globus_content,
)
Expand Down Expand Up @@ -52,85 +50,6 @@ def test_get_globus_dataset_content_sizes():
}


def test_estimate_s3_conversion_cost_standard():
test_sizes = [
1,
100,
1e3, # 1 GB
1e5, # 100 GB
1e6, # 1 TB
1e7, # 10 TB
1e8, # 100 TB
]
results = [estimate_s3_conversion_cost(total_mb=total_mb) for total_mb in test_sizes]
assert results == [
2.9730398740210563e-15, # 1 MB
2.973039874021056e-11, # 100 MB
2.9730398740210564e-09, # 1 GB
2.9730398740210563e-05, # 100 GB
0.002973039874021056, # 1 TB
0.2973039874021056, # 10 TB
29.73039874021056, # 100 TB
]


@pytest.mark.skipif(
not HAVE_GLOBUS or not LOGGED_INTO_GLOBUS,
reason="You must have globus installed and be logged in to run this test!",
)
def test_estimate_s3_conversion_cost_from_globus_single_session():
content_sizes = get_globus_dataset_content_sizes(
globus_endpoint_id="188a6110-96db-11eb-b7a9-f57b2d55370d",
path="/SenzaiY/YutaMouse41/YutaMouse41-150821/originalClu/",
)
assert estimate_s3_conversion_cost(total_mb=sum(content_sizes.values()) / 1e6) == 1.756555806400279e-13


@pytest.mark.skipif(
not HAVE_GLOBUS or not LOGGED_INTO_GLOBUS,
reason="You must have globus installed and be logged in to run this test!",
)
def test_estimate_s3_conversion_cost_from_globus_multiple_sessions():
all_content_sizes = {
session_name: get_globus_dataset_content_sizes(
globus_endpoint_id="188a6110-96db-11eb-b7a9-f57b2d55370d",
path=f"/SenzaiY/YutaMouse41/{session_name}",
)
for session_name in ["YutaMouse41-150821", "YutaMouse41-150829"]
}
assert (
sum(
[
estimate_s3_conversion_cost(total_mb=sum(content_sizes.values()) / 1e6)
for content_sizes in all_content_sizes.values()
]
)
== 1.3393785277236152e-07
)


def test_estimate_total_conversion_runtime():
test_sizes = [
1,
100,
1e3, # 1 GB
1e5, # 100 GB
1e6, # 1 TB
1e7, # 10 TB
1e8, # 100 TB
]
results = [estimate_total_conversion_runtime(total_mb=total_mb) for total_mb in test_sizes]
assert results == [
0.12352941176470589,
12.352941176470589,
123.52941176470588,
12352.94117647059,
123529.41176470589,
1235294.1176470588,
12352941.176470589,
]


@pytest.mark.skipif(
not (HAVE_GLOBUS and LOGGED_INTO_GLOBUS),
reason="You must have globus installed and be logged in to run this test!",
Expand Down
48 changes: 0 additions & 48 deletions tests/test_minimal/test_tools/s3_tools.py

This file was deleted.

0 comments on commit a970fd4

Please sign in to comment.