From 0d42df8e319fb50fdcd8f39d5e2f3353956afc5d Mon Sep 17 00:00:00 2001 From: Andrew Hearin Date: Fri, 19 Feb 2021 16:34:12 -0600 Subject: [PATCH] Added new failing unit test to address #993 --- .../hod_models/tests/test_zheng07.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/halotools/empirical_models/composite_models/hod_models/tests/test_zheng07.py b/halotools/empirical_models/composite_models/hod_models/tests/test_zheng07.py index 81e125949..4d672d54e 100644 --- a/halotools/empirical_models/composite_models/hod_models/tests/test_zheng07.py +++ b/halotools/empirical_models/composite_models/hod_models/tests/test_zheng07.py @@ -116,3 +116,20 @@ def test_mass_definition_flexibility(): halocat.halo_table["halo_mvir"] ) model.populate_mock(halocat, seed=43) + + +def test_mass_definition_flexibility2(): + """Regression test for Issue #993.""" + halocat = FakeSim() + halocat.halo_table["halo_mass_custom"] = np.copy(halocat.halo_table["halo_mvir"]) + halocat.halo_table["halo_radius_custom"] = np.copy(halocat.halo_table["halo_rvir"]) + halocat.halo_table.remove_column("halo_upid") + halocat.halo_table.remove_column("halo_mvir") + halocat.halo_table.remove_column("halo_rvir") + model = PrebuiltHodModelFactory( + "zheng07", + mdef="custom", + prim_haloprop_key="halo_mass_custom", + halo_boundary_key="halo_radius_custom", + ) + model.populate_mock(halocat)