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

Errors accessing states for People #893

Open
robynstuart opened this issue Mar 18, 2025 · 0 comments
Open

Errors accessing states for People #893

robynstuart opened this issue Mar 18, 2025 · 0 comments
Labels
v3 All v3 tasks
Milestone

Comments

@robynstuart
Copy link
Member

ppl = ss.People(1000)
ppl.age

gives the following:

Traceback (most recent call last):
  File "/Users/robynstuart/anaconda3/envs/starsim/lib/python3.9/site-packages/IPython/core/formatters.py", line 223, in catch_format_error
    r = method(self, *args, **kwargs)
  File "/Users/robynstuart/anaconda3/envs/starsim/lib/python3.9/site-packages/IPython/core/formatters.py", line 708, in __call__
    printer.pretty(obj)
  File "/Users/robynstuart/anaconda3/envs/starsim/lib/python3.9/site-packages/IPython/lib/pretty.py", line 410, in pretty
    return _repr_pprint(obj, self, cycle)
  File "/Users/robynstuart/anaconda3/envs/starsim/lib/python3.9/site-packages/IPython/lib/pretty.py", line 778, in _repr_pprint
    output = repr(obj)
  File "/Users/robynstuart/Documents/git/starsim/starsim/arrays.py", line 197, in __repr__
    arr_str = np.array2string(self.values, max_line_width=200)
  File "/Users/robynstuart/Documents/git/starsim/starsim/arrays.py", line 264, in values
    return self.raw[self.auids]
IndexError: index 0 is out of bounds for axis 0 with size 0
  1. Is there a way to create people with initialized properties ?
  2. If not, could this have a more useful error message?
@cliffckerr cliffckerr added the v3 All v3 tasks label Mar 25, 2025
@cliffckerr cliffckerr added this to the v3d-other milestone Mar 25, 2025
@cliffckerr cliffckerr added tmp and removed tmp labels Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 All v3 tasks
Projects
Status: No status
Development

No branches or pull requests

2 participants