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

numpy error when trying to call ConfigHandler to load test configs #50

Open
rahulmkarthik opened this issue Oct 30, 2023 · 1 comment
Open

Comments

@rahulmkarthik
Copy link

While trying to call ConfigHandler in the paltas_movie notebook in the lightcone repo as:

We'll pass one of our example Configs in

config_handler = ConfigHandler(r'C:\Users\hp\Documents\GitHub\lightcone\Data\Paltas\test_config.py')

I run into the error:

ValueError Traceback (most recent call last)
c:\Users\hp\Documents\GitHub\lightcone\notebooks\paltas_movie.ipynb Cell 3 line 1
12 print(root_path)
14 # We'll pass one of our example Configs in
---> 15 config_handler = ConfigHandler(r'C:\Users\hp\Documents\GitHub\lightcone\Data\Paltas\test_config.py')
17 # First let's get the lenstronomy kwargs_model and kwargs_param
18 kwargs_model, kwargs_param = config_handler.get_lenstronomy_models_kwargs()

File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\paltas-0.1.1-py3.11.egg\paltas\Configs\config_handler.py:74, in ConfigHandler.init(self, config_path)
66 self.config_dict = self.config_module.config_dict
68 # Get the random seed to use, or draw a random not-too-large one
69 # (so it is easy to copy-paste from metadata into config files)
70 # Max is 2**32 - 1, see _legacy_seeding in numpy/random/_mt19937.pyx
71 self.base_seed = getattr(
72 self.config_module,
73 'seed',
---> 74 (np.random.randint(np.iinfo(np.uint32).max,)))
75 # Make sure base_seed is a sequence, not a number
76 if isinstance(self.base_seed, (int, float)):

File mtrand.pyx:763, in numpy.random.mtrand.RandomState.randint()

File _bounded_integers.pyx:1336, in numpy.random._bounded_integers._rand_int32()

ValueError: high is out of bounds for int32

@swagnercarena
Copy link
Owner

Looks like this is a known problem with numpy on Windows: numpy/numpy#17038. Are you running on Windows?

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

2 participants