diff --git a/.github/workflows/httomolibgpu_tests_run_iris.yml b/.github/workflows/httomolibgpu_tests_run_iris.yml index de79b740..6d1b9aa3 100644 --- a/.github/workflows/httomolibgpu_tests_run_iris.yml +++ b/.github/workflows/httomolibgpu_tests_run_iris.yml @@ -21,10 +21,6 @@ jobs: - name: Checkout repository code uses: actions/checkout@v4 - - name: Set up CUDA environment - run: | - echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV - - name: Create conda environment uses: mamba-org/setup-micromamba@v1 with: diff --git a/.github/workflows/main-checks.yml b/.github/workflows/main-checks.yml index adc4dfec..de3a8366 100644 --- a/.github/workflows/main-checks.yml +++ b/.github/workflows/main-checks.yml @@ -20,10 +20,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up CUDA environment - run: | - echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV - - name: Create conda environment uses: mamba-org/setup-micromamba@v1 with: diff --git a/.scripts/download_zenodo.py b/.scripts/download_zenodo.py index 76de5010..5dbc04ad 100755 --- a/.scripts/download_zenodo.py +++ b/.scripts/download_zenodo.py @@ -19,28 +19,30 @@ def calculate_md5(filename): def download_zenodo_files(output_dir: Path): """ - Download all files from Zenodo record 14338424 and verify their checksums. - + Download all files from Zenodo record 14627503 and verify their checksums. + Args: output_dir: Directory where files should be downloaded """ try: - print("Fetching files from Zenodo record 14338424...") - with urllib.request.urlopen("https://zenodo.org/api/records/14338424") as response: + print("Fetching files from Zenodo record 14627503...") + with urllib.request.urlopen( + "https://zenodo.org/api/records/14627503" + ) as response: data = json.loads(response.read()) - + # Create output directory if it doesn't exist output_dir.mkdir(parents=True, exist_ok=True) - + # Now 'files' is a list, not a dictionary for file_info in data["files"]: filename = file_info["key"] # The 'key' is the filename output_file = output_dir / filename print(f"Downloading {filename}...") url = file_info["links"]["self"] # The link to download the file - + expected_md5 = file_info["checksum"].split(":")[1] # Extract MD5 hash - + # Download the file urllib.request.urlretrieve(url, output_file) @@ -53,9 +55,9 @@ def download_zenodo_files(output_dir: Path): print(f"Expected: {expected_md5}") print(f"Got: {actual_md5}") sys.exit(1) - + print("\nAll files downloaded and verified successfully!") - + except Exception as e: print(f"Error: {str(e)}", file=sys.stderr) sys.exit(1) @@ -65,6 +67,6 @@ def download_zenodo_files(output_dir: Path): if len(sys.argv) != 2: print("Usage: download_zenodo.py ") sys.exit(1) - + output_dir = Path(sys.argv[1]) download_zenodo_files(output_dir) diff --git a/zenodo-tests/conftest.py b/zenodo-tests/conftest.py index c8576f02..db5dd51b 100644 --- a/zenodo-tests/conftest.py +++ b/zenodo-tests/conftest.py @@ -12,49 +12,50 @@ def test_data_path(): @pytest.fixture(scope="session") -def data_i12LFOV_file(test_data_path): - in_file = os.path.join(test_data_path, "i12LFOV.npz") +def i12_dataset1_file(test_data_path): + in_file = os.path.join(test_data_path, "i12_dataset1.npz") return np.load(in_file) -@pytest.fixture(scope="session") -def data_i12_sandstone_file(test_data_path): - in_file = os.path.join(test_data_path, "i12_sandstone_50sinoslices.npz") - return np.load(in_file) +@pytest.fixture +def i12_dataset1(i12_dataset1_file): + return ( + cp.asarray(i12_dataset1_file["projdata"]), + i12_dataset1_file["angles"], + cp.asarray(i12_dataset1_file["flats"]), + cp.asarray(i12_dataset1_file["darks"]), + ) @pytest.fixture(scope="session") -def data_geant4sim_file(test_data_path): - in_file = os.path.join(test_data_path, "geant4_640_540_proj360.npz") +def i12_dataset2_file(test_data_path): + in_file = os.path.join(test_data_path, "i12_dataset2.npz") return np.load(in_file) + @pytest.fixture -def i12LFOV_data(data_i12LFOV_file): +def i12_dataset2(i12_dataset2_file): return ( - cp.asarray(data_i12LFOV_file["projdata"]), - data_i12LFOV_file["angles"], - cp.asarray(data_i12LFOV_file["flats"]), - cp.asarray(data_i12LFOV_file["darks"]), + cp.asarray(i12_dataset2_file["projdata"]), + i12_dataset2_file["angles"], + cp.asarray(i12_dataset2_file["flats"]), + cp.asarray(i12_dataset2_file["darks"]), ) -@pytest.fixture -def i12sandstone_data(data_i12_sandstone_file): - return ( - cp.asarray(data_i12_sandstone_file["projdata"]), - data_i12_sandstone_file["angles"], - cp.asarray(data_i12_sandstone_file["flats"]), - cp.asarray(data_i12_sandstone_file["darks"]), - ) +@pytest.fixture(scope="session") +def geant4_dataset1_file(test_data_path): + in_file = os.path.join(test_data_path, "geant4_dataset1.npz") + return np.load(in_file) @pytest.fixture -def geantsim_data(data_geant4sim_file): +def geant4_dataset1(geant4_dataset1_file): return ( - cp.asarray(data_geant4sim_file["projdata"]), - data_geant4sim_file["angles"], - cp.asarray(data_geant4sim_file["flats"]), - cp.asarray(data_geant4sim_file["darks"]), + cp.asarray(geant4_dataset1_file["projdata"]), + geant4_dataset1_file["angles"], + cp.asarray(geant4_dataset1_file["flats"]), + cp.asarray(geant4_dataset1_file["darks"]), ) diff --git a/zenodo-tests/test_recon/test_rotation.py b/zenodo-tests/test_recon/test_rotation.py index 536a0ace..0090b333 100644 --- a/zenodo-tests/test_recon/test_rotation.py +++ b/zenodo-tests/test_recon/test_rotation.py @@ -6,11 +6,11 @@ from httomolibgpu.recon.rotation import find_center_vo -def test_center_vo_i12LFOV(i12LFOV_data, ensure_clean_memory): - projdata = i12LFOV_data[0] - flats = i12LFOV_data[2] - darks = i12LFOV_data[3] - del i12LFOV_data +def test_center_vo_i12_dataset2(i12_dataset2, ensure_clean_memory): + projdata = i12_dataset2[0] + flats = i12_dataset2[2] + darks = i12_dataset2[3] + del i12_dataset2 data_normalised = normalize(projdata, flats, darks, minus_log=False) del flats, darks, projdata @@ -22,11 +22,11 @@ def test_center_vo_i12LFOV(i12LFOV_data, ensure_clean_memory): assert cor.dtype == np.float32 -def test_center_vo_average_i12LFOV(i12LFOV_data, ensure_clean_memory): - projdata = i12LFOV_data[0] - flats = i12LFOV_data[2] - darks = i12LFOV_data[3] - del i12LFOV_data +def test_center_vo_average_i12_dataset2(i12_dataset2, ensure_clean_memory): + projdata = i12_dataset2[0] + flats = i12_dataset2[2] + darks = i12_dataset2[3] + del i12_dataset2 data_normalised = normalize(projdata, flats, darks, minus_log=False) del flats, darks, projdata @@ -37,11 +37,11 @@ def test_center_vo_average_i12LFOV(i12LFOV_data, ensure_clean_memory): assert cor.dtype == np.float32 -def test_center_vo_i12_sandstone(i12sandstone_data, ensure_clean_memory): - projdata = i12sandstone_data[0] - flats = i12sandstone_data[2] - darks = i12sandstone_data[3] - del i12sandstone_data +def test_center_vo_i12_dataset1(i12_dataset1, ensure_clean_memory): + projdata = i12_dataset1[0] + flats = i12_dataset1[2] + darks = i12_dataset1[3] + del i12_dataset1 data_normalised = normalize(projdata, flats, darks, minus_log=True) del flats, darks, projdata @@ -53,11 +53,11 @@ def test_center_vo_i12_sandstone(i12sandstone_data, ensure_clean_memory): assert cor.dtype == np.float32 -def test_center_vo_i12_geantsim(geantsim_data, ensure_clean_memory): - projdata = geantsim_data[0] - flats = geantsim_data[2] - darks = geantsim_data[3] - del geantsim_data +def test_center_vo_geant4_dataset1(geant4_dataset1, ensure_clean_memory): + projdata = geant4_dataset1[0] + flats = geant4_dataset1[2] + darks = geant4_dataset1[3] + del geant4_dataset1 data_normalised = normalize(projdata, flats, darks, minus_log=True) del flats, darks, projdata