diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 94b318cc..6a92945d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ exclude: | repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.14.14" + rev: "v0.15.4" hooks: - id: ruff args: [--fix] diff --git a/abacusnbody/data/compaso_halo_catalog.py b/abacusnbody/data/compaso_halo_catalog.py index 95faf19d..2d62fa7a 100644 --- a/abacusnbody/data/compaso_halo_catalog.py +++ b/abacusnbody/data/compaso_halo_catalog.py @@ -820,11 +820,8 @@ def _setup_halo_field_loaders(self, passthrough=False): # r10,r25,r33,r50,r67,r75,r90,r95,r98 pat = re.compile(r'(?:r\d{1,2}|rvcirc_max)(?P_(?:L2)?com)') - self.halo_field_loaders[pat] = ( - lambda m, raw, halos: raw[m[0] + '_i16'] - * raw['r100' + m['com']] - / INT16SCALE - * box + self.halo_field_loaders[pat] = lambda m, raw, halos: ( + raw[m[0] + '_i16'] * raw['r100' + m['com']] / INT16SCALE * box ) # sigmavMin, sigmavMaj, sigmavrad, sigmavtan @@ -851,8 +848,8 @@ def _sigmav_loader(m, raw, halos): # sigmar pat = re.compile(r'sigmar(?P_(?:L2)?com)') - self.halo_field_loaders[pat] = ( - lambda m, raw, halos: raw[m[0] + '_i16'] + self.halo_field_loaders[pat] = lambda m, raw, halos: ( + raw[m[0] + '_i16'] * raw['r100' + m['com']].reshape(-1, 1) / INT16SCALE * box @@ -860,8 +857,8 @@ def _sigmav_loader(m, raw, halos): # sigman pat = re.compile(r'sigman(?P_(?:L2)?com)') - self.halo_field_loaders[pat] = ( - lambda m, raw, halos: raw[m[0] + '_i16'] / INT16SCALE + self.halo_field_loaders[pat] = lambda m, raw, halos: ( + raw[m[0] + '_i16'] / INT16SCALE ) # x,r100 (box-scaled fields)