Skip to content

Commit

Permalink
Merge pull request #2301 from SCIInstitute/test_updates
Browse files Browse the repository at this point in the history
Dataset Test updates
  • Loading branch information
akenmorris authored Aug 2, 2024
2 parents d2e42cd + 65369fb commit 44ab4d5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Examples/Python/Data/femur_pvalues.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions Examples/Python/Data/supershapes_1mode_contour.zip
Git LFS file not shown
2 changes: 1 addition & 1 deletion Examples/Python/ellipsoid_fd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def Run_Pipeline(args):
We define dataset_name which determines which dataset to download from
the portal and the directory to save output from the use case in.
"""
dataset_name = "ellipsoid_fd"
dataset_name = "ellipsoid_fd_multiscale"
output_directory = "Output/ellipsoid_fd/"
if not os.path.exists(output_directory):
os.makedirs(output_directory)
Expand Down
8 changes: 6 additions & 2 deletions Examples/Python/femur_pvalues.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import numpy as np
import pandas as pd
import json
import zipfile

def Run_Pipeline(args):
output_directory = 'Output/femur_pvalues/'
if not os.path.exists(output_directory):
os.makedirs(output_directory)

dataset_name = 'femur_pvalues'
sw.download_dataset(dataset_name, output_directory)
# unzip Data/femur_pvalues.zip
zip_file = 'Data/femur_pvalues.zip'
with zipfile.ZipFile(zip_file, 'r') as zip_ref:
zip_ref.extractall("Output/")

swproj_file = f'{output_directory}/femur_pvalues.swproj'
csvfile = convert_swproj_to_csv(swproj_file)
data = pd.read_csv(csvfile)
Expand Down
8 changes: 7 additions & 1 deletion Examples/Python/supershapes_1mode_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import shapeworks as sw
import subprocess
import numpy as np
import zipfile

from ShapeCohortGen.CohortGenerator import Supershapes2DCohortGenerator

def Run_Pipeline(args):
Expand All @@ -21,8 +23,12 @@ def Run_Pipeline(args):
output_directory = "Output/supershapes_1mode_contour/"
if not os.path.exists(output_directory):
os.makedirs(output_directory)

# See the generate_supershapes() function in this file for how the data is generated
sw.download_dataset(dataset_name, output_directory)
zip_file = 'Data/supershapes_1mode_contour.zip'
with zipfile.ZipFile(zip_file, 'r') as zip_ref:
zip_ref.extractall("Output/")
# sw.download_dataset(dataset_name, output_directory)
dataset_name = "supershapes2D_1mode"
contour_files = sorted(glob.glob(output_directory + dataset_name + "/contours/*.vtp"))

Expand Down
1 change: 1 addition & 0 deletions Studio/Analysis/AnalysisTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ bool AnalysisTool::compute_stats() {
auto local_particles = shape->get_particles().get_local_particles();
if (local_particles.size() != domains_per_shape) {
SW_ERROR("Inconsistency in number of particles size");
return false;
}
for (unsigned int i = 0; i < domains_per_shape; i++) {
number_of_particles_array_[i] = local_particles[i].size() / 3;
Expand Down

0 comments on commit 44ab4d5

Please sign in to comment.