Keyerror: "mass"

21 views
Skip to first unread message

Thor Tepper-Garcia

unread,
Feb 21, 2024, 5:44:47 PM2/21/24
to pynbody-users
Dear all,

On Pynbody 1.3.1 I'm experiencing a *really* weird issue when loading a Ramses output; i.e. when doing:

s = pynbody.load('output_00029')
s['mass']

results in:

KeyError: "'mass' is a family-level array for [<Family dm>, <Family star>, <Family cloud>, <Family sink>]. To use it over the whole simulation you need either to delete it first, or create it separately for [<Family gas>]."

I can get around the issue by doing first:

s.g['mass']

but that is just a workaround and I'd like to understand what is going on. Any ideas?

Cheers

Thor

Andrew Pontzen

unread,
Feb 22, 2024, 1:25:11 AM2/22/24
to Thor Tepper-Garcia, pynbody-users
Thanks Thor

The problem is related to the way that gas masses are derived from their density, whereas particle masses are stored in the file itself.

That said, I don’t think this should be happening so please could you file a bug report on github, with all details needed to reproduce?

All the best, Andrew



--
You received this message because you are subscribed to the Google Groups "pynbody-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynbody-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynbody-users/a1b2db7a-22c4-49a0-b6f8-a5670cac9a7fn%40googlegroups.com.

Thor

unread,
Feb 22, 2024, 1:51:42 AM2/22/24
to Andrew Pontzen, Dr. Thorsten Tepper Garcia, pynbody-users
Hi Andrew,

Many thanks for your prompt reply!

The code snippet I shared is all there is to it, but of course, I have the data.
Do you want me to upload the output data as well? If so, where? Not sure GitHub bug report interface allows for that.
It’s roughly 1.4GB of data.

Cheers

Thor

___________________________
Dr. Thor Tepper García
Astrophysicist
www.thorsten.mx
@thorsten_mx

Pontzen, Andrew

unread,
Feb 22, 2024, 4:06:51 AM2/22/24
to Thor, pynbody-users
There needs to be a reproducible example, yes! Either upload the data somewhere of your choosing or confirm that it can be reproduced on pynbody’s own test data.

Thanks, Andrew

> On 22 Feb 2024, at 06:51, Thor <ttep...@gmail.com> wrote:
>
> ⚠ Caution: External sender
>
>
> Hi Andrew,
>
> Many thanks for your prompt reply!
>
> The code snippet I shared is all there is to it, but of course, I have the data.
> Do you want me to upload the output data as well? If so, where? Not sure GitHub bug report interface allows for that.
> It’s roughly 1.4GB of data.
>
> Cheers
>
> Thor
>
> ___________________________
> Dr. Thor Tepper García
> Astrophysicist
> http://www.thorsten.mx/
Reply all
Reply to author
Forward
0 new messages