Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions SOAP/compute_halo_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import os
import os.path
import sys
import time
import traceback
import numpy as np
Expand Down Expand Up @@ -564,6 +565,8 @@ def compute_halo_properties():
)
except Exception as e:
traceback.print_exc()
sys.stdout.flush()
sys.stderr.flush()
comm_world.Abort(1)

# Can stop the halo request thread now that all chunk tasks have executed
Expand Down
4 changes: 3 additions & 1 deletion SOAP/core/halo_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def process_single_halo(
# Calculation caused an unexpected error.
# Output the halo ID so we can debug this.
print(
f"Object with HaloCatalogueIndex={input_halo['index']} encountered an error"
f"Object with HaloCatalogueIndex={input_halo['index']} encountered an error "
f"while calculating {halo_prop.name}",
flush=True,
)
raise
else:
Expand Down
9 changes: 8 additions & 1 deletion SOAP/particle_selection/SO_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -3674,7 +3674,14 @@ def calculate(
unit = unit * unyt.Unit("a", registry=registry) ** a_exponent
if do_calculation[filter_name]:
t0_calc = time.time()
val = getattr(part_props, name)
try:
val = getattr(part_props, name)
except Exception as e:
e.add_note(
f"Error calculating {prop.name} for subhalo "
f"{input_halo['index']}"
)
raise
if val is not None:
assert (
SO[name].shape == val.shape
Expand Down
9 changes: 8 additions & 1 deletion SOAP/particle_selection/aperture_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -4176,7 +4176,14 @@ def calculate(
unit = unit * unyt.Unit("a", registry=registry) ** a_exponent
if do_calculation[filter_name]:
t0_calc = time.time()
val = getattr(part_props, name)
try:
val = getattr(part_props, name)
except Exception as e:
e.add_note(
f"Error calculating {prop.name} for subhalo "
f"{input_halo['index']}"
)
raise
if val is not None:
assert (
aperture_sphere[name].shape == val.shape
Expand Down
9 changes: 8 additions & 1 deletion SOAP/particle_selection/projected_aperture_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,14 @@ def calculate(
unit = unit * unyt.Unit("a", registry=registry) ** a_exponent
if do_calculation[filter_name]:
t0_calc = time.time()
val = getattr(proj_part_props, name)
try:
val = getattr(proj_part_props, name)
except Exception as e:
e.add_note(
f"Error calculating {prop.name} ({projname}) "
f"for subhalo {input_halo['index']}"
)
raise
if val is not None:
assert (
projected_aperture[projname][name].shape == val.shape
Expand Down
9 changes: 8 additions & 1 deletion SOAP/particle_selection/subhalo_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,14 @@ def calculate(self, input_halo, search_radius, data, halo_result):
)
if do_calculation[filter_name]:
t0_calc = time.time()
val = getattr(part_props, name)
try:
val = getattr(part_props, name)
except Exception as e:
e.add_note(
f"Error calculating {prop.name} for subhalo "
f"{input_halo['index']}"
)
raise
if val is not None:
assert (
subhalo[name].shape == val.shape
Expand Down
3 changes: 3 additions & 0 deletions SOAP/property_calculation/inertia_tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ def get_weighted_projected_inertia_tensor(
tensor = tensor.sum(axis=0)
eig_val, eig_vec = np.linalg.eigh(tensor.value)

# Handle overflows into negative values of very small eigenvalues
eig_val = np.abs(eig_val)

# Handle cases where there is only one particle after iterating.
if q == 0:
tensor.fill(0)
Expand Down
Loading