Skip to content

Commit d9f56b4

Browse files
authored
Merge pull request #182 from DiamondLightSource/zenodo_upd
updating zenodo doi and tests
2 parents 0f2c20d + 4ac6164 commit d9f56b4

File tree

5 files changed

+60
-65
lines changed

5 files changed

+60
-65
lines changed

.github/workflows/httomolibgpu_tests_run_iris.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ jobs:
2121
- name: Checkout repository code
2222
uses: actions/checkout@v4
2323

24-
- name: Set up CUDA environment
25-
run: |
26-
echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
27-
2824
- name: Create conda environment
2925
uses: mamba-org/setup-micromamba@v1
3026
with:

.github/workflows/main-checks.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23-
- name: Set up CUDA environment
24-
run: |
25-
echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
26-
2723
- name: Create conda environment
2824
uses: mamba-org/setup-micromamba@v1
2925
with:

.scripts/download_zenodo.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,30 @@ def calculate_md5(filename):
1919

2020
def download_zenodo_files(output_dir: Path):
2121
"""
22-
Download all files from Zenodo record 14338424 and verify their checksums.
23-
22+
Download all files from Zenodo record 14627503 and verify their checksums.
23+
2424
Args:
2525
output_dir: Directory where files should be downloaded
2626
"""
2727
try:
28-
print("Fetching files from Zenodo record 14338424...")
29-
with urllib.request.urlopen("https://zenodo.org/api/records/14338424") as response:
28+
print("Fetching files from Zenodo record 14627503...")
29+
with urllib.request.urlopen(
30+
"https://zenodo.org/api/records/14627503"
31+
) as response:
3032
data = json.loads(response.read())
31-
33+
3234
# Create output directory if it doesn't exist
3335
output_dir.mkdir(parents=True, exist_ok=True)
34-
36+
3537
# Now 'files' is a list, not a dictionary
3638
for file_info in data["files"]:
3739
filename = file_info["key"] # The 'key' is the filename
3840
output_file = output_dir / filename
3941
print(f"Downloading {filename}...")
4042
url = file_info["links"]["self"] # The link to download the file
41-
43+
4244
expected_md5 = file_info["checksum"].split(":")[1] # Extract MD5 hash
43-
45+
4446
# Download the file
4547
urllib.request.urlretrieve(url, output_file)
4648

@@ -53,9 +55,9 @@ def download_zenodo_files(output_dir: Path):
5355
print(f"Expected: {expected_md5}")
5456
print(f"Got: {actual_md5}")
5557
sys.exit(1)
56-
58+
5759
print("\nAll files downloaded and verified successfully!")
58-
60+
5961
except Exception as e:
6062
print(f"Error: {str(e)}", file=sys.stderr)
6163
sys.exit(1)
@@ -65,6 +67,6 @@ def download_zenodo_files(output_dir: Path):
6567
if len(sys.argv) != 2:
6668
print("Usage: download_zenodo.py <output_directory>")
6769
sys.exit(1)
68-
70+
6971
output_dir = Path(sys.argv[1])
7072
download_zenodo_files(output_dir)

zenodo-tests/conftest.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,50 @@ def test_data_path():
1212

1313

1414
@pytest.fixture(scope="session")
15-
def data_i12LFOV_file(test_data_path):
16-
in_file = os.path.join(test_data_path, "i12LFOV.npz")
15+
def i12_dataset1_file(test_data_path):
16+
in_file = os.path.join(test_data_path, "i12_dataset1.npz")
1717
return np.load(in_file)
1818

1919

20-
@pytest.fixture(scope="session")
21-
def data_i12_sandstone_file(test_data_path):
22-
in_file = os.path.join(test_data_path, "i12_sandstone_50sinoslices.npz")
23-
return np.load(in_file)
20+
@pytest.fixture
21+
def i12_dataset1(i12_dataset1_file):
22+
return (
23+
cp.asarray(i12_dataset1_file["projdata"]),
24+
i12_dataset1_file["angles"],
25+
cp.asarray(i12_dataset1_file["flats"]),
26+
cp.asarray(i12_dataset1_file["darks"]),
27+
)
2428

2529

2630
@pytest.fixture(scope="session")
27-
def data_geant4sim_file(test_data_path):
28-
in_file = os.path.join(test_data_path, "geant4_640_540_proj360.npz")
31+
def i12_dataset2_file(test_data_path):
32+
in_file = os.path.join(test_data_path, "i12_dataset2.npz")
2933
return np.load(in_file)
3034

35+
3136
@pytest.fixture
32-
def i12LFOV_data(data_i12LFOV_file):
37+
def i12_dataset2(i12_dataset2_file):
3338
return (
34-
cp.asarray(data_i12LFOV_file["projdata"]),
35-
data_i12LFOV_file["angles"],
36-
cp.asarray(data_i12LFOV_file["flats"]),
37-
cp.asarray(data_i12LFOV_file["darks"]),
39+
cp.asarray(i12_dataset2_file["projdata"]),
40+
i12_dataset2_file["angles"],
41+
cp.asarray(i12_dataset2_file["flats"]),
42+
cp.asarray(i12_dataset2_file["darks"]),
3843
)
3944

4045

41-
@pytest.fixture
42-
def i12sandstone_data(data_i12_sandstone_file):
43-
return (
44-
cp.asarray(data_i12_sandstone_file["projdata"]),
45-
data_i12_sandstone_file["angles"],
46-
cp.asarray(data_i12_sandstone_file["flats"]),
47-
cp.asarray(data_i12_sandstone_file["darks"]),
48-
)
46+
@pytest.fixture(scope="session")
47+
def geant4_dataset1_file(test_data_path):
48+
in_file = os.path.join(test_data_path, "geant4_dataset1.npz")
49+
return np.load(in_file)
4950

5051

5152
@pytest.fixture
52-
def geantsim_data(data_geant4sim_file):
53+
def geant4_dataset1(geant4_dataset1_file):
5354
return (
54-
cp.asarray(data_geant4sim_file["projdata"]),
55-
data_geant4sim_file["angles"],
56-
cp.asarray(data_geant4sim_file["flats"]),
57-
cp.asarray(data_geant4sim_file["darks"]),
55+
cp.asarray(geant4_dataset1_file["projdata"]),
56+
geant4_dataset1_file["angles"],
57+
cp.asarray(geant4_dataset1_file["flats"]),
58+
cp.asarray(geant4_dataset1_file["darks"]),
5859
)
5960

6061

zenodo-tests/test_recon/test_rotation.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
from httomolibgpu.recon.rotation import find_center_vo
77

88

9-
def test_center_vo_i12LFOV(i12LFOV_data, ensure_clean_memory):
10-
projdata = i12LFOV_data[0]
11-
flats = i12LFOV_data[2]
12-
darks = i12LFOV_data[3]
13-
del i12LFOV_data
9+
def test_center_vo_i12_dataset2(i12_dataset2, ensure_clean_memory):
10+
projdata = i12_dataset2[0]
11+
flats = i12_dataset2[2]
12+
darks = i12_dataset2[3]
13+
del i12_dataset2
1414

1515
data_normalised = normalize(projdata, flats, darks, minus_log=False)
1616
del flats, darks, projdata
@@ -22,11 +22,11 @@ def test_center_vo_i12LFOV(i12LFOV_data, ensure_clean_memory):
2222
assert cor.dtype == np.float32
2323

2424

25-
def test_center_vo_average_i12LFOV(i12LFOV_data, ensure_clean_memory):
26-
projdata = i12LFOV_data[0]
27-
flats = i12LFOV_data[2]
28-
darks = i12LFOV_data[3]
29-
del i12LFOV_data
25+
def test_center_vo_average_i12_dataset2(i12_dataset2, ensure_clean_memory):
26+
projdata = i12_dataset2[0]
27+
flats = i12_dataset2[2]
28+
darks = i12_dataset2[3]
29+
del i12_dataset2
3030

3131
data_normalised = normalize(projdata, flats, darks, minus_log=False)
3232
del flats, darks, projdata
@@ -37,11 +37,11 @@ def test_center_vo_average_i12LFOV(i12LFOV_data, ensure_clean_memory):
3737
assert cor.dtype == np.float32
3838

3939

40-
def test_center_vo_i12_sandstone(i12sandstone_data, ensure_clean_memory):
41-
projdata = i12sandstone_data[0]
42-
flats = i12sandstone_data[2]
43-
darks = i12sandstone_data[3]
44-
del i12sandstone_data
40+
def test_center_vo_i12_dataset1(i12_dataset1, ensure_clean_memory):
41+
projdata = i12_dataset1[0]
42+
flats = i12_dataset1[2]
43+
darks = i12_dataset1[3]
44+
del i12_dataset1
4545

4646
data_normalised = normalize(projdata, flats, darks, minus_log=True)
4747
del flats, darks, projdata
@@ -53,11 +53,11 @@ def test_center_vo_i12_sandstone(i12sandstone_data, ensure_clean_memory):
5353
assert cor.dtype == np.float32
5454

5555

56-
def test_center_vo_i12_geantsim(geantsim_data, ensure_clean_memory):
57-
projdata = geantsim_data[0]
58-
flats = geantsim_data[2]
59-
darks = geantsim_data[3]
60-
del geantsim_data
56+
def test_center_vo_geant4_dataset1(geant4_dataset1, ensure_clean_memory):
57+
projdata = geant4_dataset1[0]
58+
flats = geant4_dataset1[2]
59+
darks = geant4_dataset1[3]
60+
del geant4_dataset1
6161

6262
data_normalised = normalize(projdata, flats, darks, minus_log=True)
6363
del flats, darks, projdata

0 commit comments

Comments
 (0)