bccp / nbodykit

Analysis kit for large-scale structure datasets, the massively parallel way
http://nbodykit.rtfd.io
GNU General Public License v3.0
111 stars 60 forks source link

HODCatalog is not defined #625

Open zhaoruiyang98 opened 4 years ago

zhaoruiyang98 commented 4 years ago

Hi, I am a newcomer to nbodykit and I am following cookbooks on the site.

But when I run codes in Halo Occupation Distribution (HOD) Mocks, error appears which says "HODCatalog is not defined".

I checked nbodykit APIs, It seems like HODCatalog is not defined in nbodykit. Is this Class deprecated? What should I do instead?

Many thanks!

rainwoodman commented 4 years ago

Yes. The example is out of date.

Take a look at this? The to_halos() function should return a HaloCatalog, and the populate method is probably what you are looking for.

https://nbodykit.readthedocs.io/en/latest/api/_autosummary/nbodykit.source.catalog.halos.html#nbodykit.source.catalog.halos.HaloCatalog.populate

Let me know how it goes -- we shall update the example notebook.

On Sun, Jul 19, 2020 at 10:41 PM zhaoruiyang98 notifications@github.com wrote:

Hi, I am a newcomer to nbodykit and I am following cookbooks on the site.

But when I run codes in Halo Occupation Distribution (HOD) Mocks https://nbodykit.readthedocs.io/en/latest/cookbook/hod-mocks.html, error appears which says "HODCatalog is not defined".

I checked nbodykit APIs, It seems like HODCatalog is not defined in nbodykit. Is this Class deprecated? What should I do instead?

Many thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bccp/nbodykit/issues/625, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABBWTEUW4DHSQI3NYXLARDR4PKG5ANCNFSM4PB4NSVA .

zhaoruiyang98 commented 4 years ago

Thanks for your reply! I replace cell 7 with hod=halos.populate(Zheng07Model,seed=42) and it works well now.

rainwoodman commented 4 years ago

Sure. But let's keep this open as a reminder we shall update the example notebook. :)

margiofabiolad commented 3 years ago

Sure. But let's keep this open as a reminder we shall update the example notebook. :)

I had the same problem with the HODCatalog and I use your solution and @zhaoruiyang98 and it works, but your should update the example. Thanks! :)