Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Importing positional_marked_npairs_3d from halotools.mock_observables.pair_counters #1074

Open
mi-song opened this issue Oct 24, 2023 · 2 comments

Comments

@mi-song
Copy link

mi-song commented Oct 24, 2023

I've encountered an issue when trying to run my code which utilizes the halotools library. Specifically, I'm having trouble importing the positional_marked_npairs_3d function from the halotools.mock_observables.pair_counters module.

Here's the error traceback I received:

Traceback (most recent call last):
File "C:\Users\82103\Desktop\graphgan\GraphGAN\2d_alignment.py", line 12, in
from halotools_ia.correlation_functions import ed_3d, ee_3d, ed_3d_one_two_halo_decomp
File "C:\Users\82103\Desktop\graphgan\GraphGAN\halotools_ia\correlation_functions_init_.py", line 11, in
from .ed_3d import ed_3d
File "C:\Users\82103\Desktop\graphgan\GraphGAN\halotools_ia\correlation_functions\ed_3d.py", line 15, in
from halotools.mock_observables.pair_counters import positional_marked_npairs_3d, npairs_3d, marked_npairs_3d
ImportError: cannot import name 'positional_marked_npairs_3d' from 'halotools.mock_observables.pair_counters' (C:\Users\82103.conda\envs\galaxygan\lib\site-packages\halotools\mock_observables\pair_counters_init_.py)

I've tried using both version 0.8.0 and 0.8.2 of halotools, but encountered the same error in both versions. I've verified my halotools installation and even tried different versions, but the issue persists. I'm wondering if this function has been moved to a different module or if there might be some other underlying issue I'm not aware of.

Any guidance or assistance on this matter would be greatly appreciated.

Thank you for your time and consideration.

@nvanalfen
Copy link
Contributor

nvanalfen commented Oct 25, 2023

@mi-song I think I see what happened, please let me know if this helps.

We indeed did move some things around. Specifically, halotools_ia (from your import) no longer exists and had been merged into halotools itself. That means the import
halotools_ia.correlation_functions import ed_3d, ee_3d, ed_3d_one_two_halo_decomp
should no longer work.

The import for what you want should now be
from halotools.mock_observables.ia_correlations import ed_3d, ee_3d, ed_3d_one_two_halo_decomp

Please try this out and let me know if it fixes things. If not, ping me on your next reply and I'll keep looking into it

@aphearin
Copy link
Contributor

aphearin commented Nov 1, 2023

@mi-song did this resolve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants