Missing potential method ?

15 views
Skip to first unread message

Thor Tepper-Garcia

unread,
Aug 23, 2024, 2:01:10 AM8/23/24
to pynbody-users
Dear all,

Apologies if this is well-known, and I just happened to be living under a rock, as it were, but whatever happened to the pynbody.analysis.gravity.potential method?

The documentation describes it, but it does not seem to be available in version 1.3.1 anymore. In fact there is not module pynbody.analysis.gravity either, but rather pynbody.gravity, which does not appear to be documented.

My actual goal is to calculate the potential induced by all (or a subset of) the particles in a simulation at a given point. Is that still possible with Pynbody as it stands, or am I better off using, e.g. pykdgrav?

Cheers

Thor

Andrew Pontzen

unread,
Aug 23, 2024, 7:59:07 AM8/23/24
to Thor Tepper-Garcia, pynbody-users
Hi Thor,

Are you maybe using a 2.0 beta branch while looking at 1.3.x documentation? The 2.0 documentation describes how this has been rationalised and moved into pynbody.gravity (https://pynbody.readthedocs.io/latest/reference/_autosummary/pynbody.gravity.direct.html#pynbody.gravity.direct) . In 1.3.x I don't believe it has changed for many years.

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/76eb3c3e-81ac-46bd-9712-6dd82d34fc14n%40googlegroups.com.

Thor

unread,
Sep 3, 2024, 10:35:53 PM9/3/24
to pynbody-users, Dr. Thorsten Tepper Garcia
Hi Andrew,

Many thanks for your reply.

I’m 100% sure that the version I’ve installed is 1.3.1, since within the interpreter I get:

>>> pynbody.__version__
'1.3.1'

And yet:

>>> dir(pynbody.gravity)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_gravity', 'calc', 'tree']
I would not even know what I could possibly have a beta version installed.

exists in there, and it seems to be what should be present in 2.0 beta, if I understood correctly.

So, as you may imagine, l I’m very confused…

But thanks for sharing the link to the latest documentation, I’ll use that from now on,
as apparently, regardless of the version I have installed, it corresponds to the one describe in there.

Cheers


Thor

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

Andrew Pontzen

unread,
Sep 4, 2024, 3:48:38 AM9/4/24
to pynbody-users
Hi Thor

I’m afraid I’m a little confused myself but all I can practically suggest for now is that you use 2.0 beta (https://pynbody.readthedocs.io/latest/)- it’s not far off stable and will future-proof your project, and the documentation is far more accurate than the 1.3.x series ever was. 

All the best, Andrew



Thor

unread,
Sep 10, 2024, 10:39:00 PM9/10/24
to Andrew Pontzen, pynbody-users
Hi Andrew,

Many thanks for your reply, and for the advice.

And sorry for the typos in my previous email;
It seems as if some copy-pasting went awry :D


Cheers

Thor

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

> To view this discussion on the web visit https://groups.google.com/d/msgid/pynbody-users/CAMSGDb%2BcKj%2BhDsQ5Bf6W_nCtSKpQeq0PNBkTR-GxwBirdVaygg%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages