[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Numcosmo-help] Python structure

From: Sandro Dias Pinto Vitenti
Subject: Re: [Numcosmo-help] Python structure
Date: Mon, 28 Jan 2019 10:32:09 -0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Hello Arthur,

The bindings are built automatically using the tool
gobject-introspection. The problem with this function (and all others
that receive/return long double variables) is that the python does not
have a builtin long double type (you may find some extension on numpy or
similar libraries, but not builtin the language), for this reason there
is no way to create bindings for these functions without losing
precision. One possible workaround would be to create wrapper functions
that just recast the return value to double.

> Is there any standards that tells how the numcosmo methods are
> transferred to python?

In principle all methods that have all their arguments and return values
whose types have a known translation for other languages. These types
include the basic types:
, and all other objects and boxed objects defined in the library.

Sandro Vitenti

On 1/27/19 1:25 PM, Arthur Constantino Scardua wrote:
> Dear all,
> what is the structure of Numcosmo bindings in Python? For instance, how
> can I access the the method  ncm_c_sqrt_1_4pi() [numcosmo/math/ncm_c.h]
> that returns a constant using Python?
> I've seen there is the NumCosmoMath.C module [from gi.repository import
> NumCosmoMath.C] that has some methods for constants like
> blackbody_energy_density() which name in ncm_c.h is
> ncm_c_blackbody_energy_density(), but I couldn't find any
> ncm_c_sqrt_1_4pi() or sqrt_1_4pi() method.
> Is there any standards that tells how the numcosmo methods are
> transferred to python?
> Cheers,
> Arthur Constantino Scardua

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]