Skip to content

Commit

Permalink
np.nan when file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Aug 21, 2023
1 parent de2f7dd commit 4af6475
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion quantconn/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,15 @@ def save_empty_bundle_profiles(bundle_name, metric_folder, out_dir, stype=None):


def evaluate_matrice(input_path, output_path, use_networkx=False):
filepath = pjoin(input_path, 'connectivity_matrice.npy')

if not os.path.exists(filepath):
res = np.ones(3) * np.nan
np.save(pjoin(output_path, f"conn_matrice_score_{input_path[-1]}.npy"), res)
return

# Load the matrice
connectivity_matrix = np.load(pjoin(input_path, 'connectivity_matrice.npy'))
connectivity_matrix = np.load(filepath)

if use_networkx:
res = evaluate_matrice_networkx(connectivity_matrix)
Expand Down

0 comments on commit 4af6475

Please sign in to comment.