Skip to main content

Jpp Python Package

Project description

The jppy Python package

https://git.km3net.de/km3py/jppy/badges/master/pipeline.svg https://git.km3net.de/km3py/jppy/badges/master/coverage.svg https://examples.pages.km3net.de/km3badges/docs-latest-brightgreen.svg

This software provides Python access to functionalities in Jpp, like accesing PDF functions.

It currently depends on a few Jpp headers (no Jpp compilation needed) and on ROOT TMath (a compiled ROOT installation is needed).

Note: Beware that this package is WIP!

Installation

The package can be installed via pip directly from the Git repository:

pip install git+https://git.km3net.de/km3py/jppy

or from a local clone:

git clone https://git.km3net.de/km3py/jppy
pip install jppy/

Example - Using PDFs

Here is an example how to play around with muon PDFs using the jppy module:

In [1]: import jppy

In [2]: jppy.pdf.JMuonPDF?
Docstring:      <no docstring>
Init docstring: __init__(self: jppy.pdf.JMuonPDF, file_descriptor: str, TTS: float, number_of_points: int = 25, epsilon: float = 1e-10) -> None
File:           ~/dev/pybind/jppy.pdf.cpython-37m-x86_64-linux-gnu.so
Type:           pybind11_type
Subclasses:

In [3]:
Do you really want to exit ([y]/n)? n

In [3]: muon_pdf = jppy.pdf.JMuonPDF("/pbs/throng/km3net/src/Jpp/master/data/J%p.dat", 0)
loading input from file /pbs/throng/km3net/src/Jpp/master/data/J1p.dat... OK
loading input from file /pbs/throng/km3net/src/Jpp/master/data/J2p.dat... OK
loading input from file /pbs/throng/km3net/src/Jpp/master/data/J3p.dat... OK
loading input from file /pbs/throng/km3net/src/Jpp/master/data/J4p.dat... OK
loading input from file /pbs/throng/km3net/src/Jpp/master/data/J5p.dat... OK
loading input from file /pbs/throng/km3net/src/Jpp/master/data/J6p.dat... OK
adding PDFs... OK

In [4]: muon_pdf.calculate?
Docstring: calculate(self: jppy.pdf.JMuonPDF, E: float, R: float, theta: float, phi: float, t1: float) -> JTOOLS::JResultPDF<double>
Type:      method

In [5]: result = muon_pdf.calculate(10, 5, 0, 0, 23)

In [6]: result.f
Out[6]: 0.0015357848280127355

In [7]: result.fp
Out[7]: -2.228096911939611e-05

In [8]: result.v
Out[8]: 0.02490276362751662

In [9]: result.V
Out[9]: 0.1164929687159807

In [10]: %timeit muon_pdf.calculate(10, 5, 0, 0, 23)
2.13 µs ± 242 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jppy-3.0.0a6.tar.gz (12.4 kB view details)

Uploaded Source

File details

Details for the file jppy-3.0.0a6.tar.gz.

File metadata

  • Download URL: jppy-3.0.0a6.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1

File hashes

Hashes for jppy-3.0.0a6.tar.gz
Algorithm Hash digest
SHA256 30ec830fff1a33526f1eec5b759ec11c39a91f7c8e3f359f23a87f136d4481fd
MD5 eabbeae0a4e0af7606c5087aeef1612d
BLAKE2b-256 ba4dfc1a8591531b62898ea6b22a425c91b8b013497dae35211b485bcabac2f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page