gluex-lumi 0.1.3__cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gluex_lumi/__init__.py
ADDED
gluex_lumi/__init__.pyi
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Typed interface for the gluex_lumi Python bindings."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Mapping, Sequence
|
|
6
|
+
|
|
7
|
+
class Histogram:
|
|
8
|
+
counts: list[float]
|
|
9
|
+
edges: list[float]
|
|
10
|
+
errors: list[float]
|
|
11
|
+
|
|
12
|
+
def __init__(
|
|
13
|
+
self, counts: list[float], edges: list[float], errors: list[float]
|
|
14
|
+
) -> None: ...
|
|
15
|
+
def as_dict(self) -> dict[str, list[float]]: ...
|
|
16
|
+
|
|
17
|
+
class FluxHistograms:
|
|
18
|
+
tagged_flux: Histogram
|
|
19
|
+
tagm_flux: Histogram
|
|
20
|
+
tagh_flux: Histogram
|
|
21
|
+
tagged_luminosity: Histogram
|
|
22
|
+
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
tagged_flux: Histogram,
|
|
26
|
+
tagm_flux: Histogram,
|
|
27
|
+
tagh_flux: Histogram,
|
|
28
|
+
tagged_luminosity: Histogram,
|
|
29
|
+
) -> None: ...
|
|
30
|
+
def as_dict(self) -> dict[str, dict[str, list[float]]]: ...
|
|
31
|
+
|
|
32
|
+
def get_flux_histograms(
|
|
33
|
+
run_periods: Mapping[str, int | None],
|
|
34
|
+
edges: Sequence[float],
|
|
35
|
+
*,
|
|
36
|
+
coherent_peak: bool = False,
|
|
37
|
+
polarized: bool = False,
|
|
38
|
+
rcdb: str | None = None,
|
|
39
|
+
ccdb: str | None = None,
|
|
40
|
+
exclude_runs: Sequence[int] | None = None,
|
|
41
|
+
) -> FluxHistograms: ...
|
|
42
|
+
def cli() -> None: ...
|
|
Binary file
|
gluex_lumi/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gluex-lumi
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
5
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Rust
|
|
13
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
14
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
15
|
+
Requires-Dist: matplotlib>=3 ; extra == 'plot'
|
|
16
|
+
Requires-Dist: pytest ; extra == 'tests'
|
|
17
|
+
Provides-Extra: plot
|
|
18
|
+
Provides-Extra: tests
|
|
19
|
+
Summary: Python bindings for GlueX luminosity calculations
|
|
20
|
+
Keywords: gluex,luminosity,physics
|
|
21
|
+
Home-Page: https://github.com/denehoffman/gluex-rs
|
|
22
|
+
Author-email: Nathaniel Dene Hoffman <dene@cmu.edu>
|
|
23
|
+
License: Apache-2.0 OR MIT
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
26
|
+
Project-URL: Documentation, https://github.com/denehoffman/gluex-rs/tree/main/crates/gluex-lumi-py
|
|
27
|
+
Project-URL: Homepage, https://github.com/denehoffman/gluex-rs
|
|
28
|
+
Project-URL: Issues, https://github.com/denehoffman/gluex-rs/issues
|
|
29
|
+
Project-URL: Repository, https://github.com/denehoffman/gluex-rs
|
|
30
|
+
|
|
31
|
+
# gluex-lumi (Python)
|
|
32
|
+
|
|
33
|
+
Python bindings for the GlueX luminosity calculators. The package exposes `get_flux_histograms`
|
|
34
|
+
from the Rust crate and an entrypoint for the `gluex-lumi` CLI. Use `--plot=path.png` to save
|
|
35
|
+
a matplotlib figure when running from the CLI.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Add to an existing Python project:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv pip install gluex-lumi
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
or install as a CLI tool:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uv tool install gluex-lumi
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
To write a plot image from the CLI:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
gluex-lumi --plot=flux.png --run f18=0 --bins=40 --coherent-peak --polarized \
|
|
55
|
+
--rcdb=rcdb.sqlite --ccdb=ccdb.sqlite --min=8.0 --max=9.0
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Example
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import gluex_lumi as lumi
|
|
62
|
+
|
|
63
|
+
edges = [7.5 + 0.05 * i for i in range(21)]
|
|
64
|
+
histos = lumi.get_flux_histograms(
|
|
65
|
+
{"f18": None}, # uses current timestamp rather than REST version
|
|
66
|
+
edges,
|
|
67
|
+
coherent_peak=True,
|
|
68
|
+
rcdb="/data/rcdb.sqlite",
|
|
69
|
+
ccdb="/data/ccdb.sqlite",
|
|
70
|
+
exclude_runs=[50000, 50001],
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
luminosity = histos.tagged_luminosity.as_dict()
|
|
74
|
+
print("bin edges:", luminosity["edges"])
|
|
75
|
+
print("counts:", luminosity["counts"])
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
Dual-licensed under Apache-2.0 or MIT.
|
|
81
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
gluex_lumi/__init__.py,sha256=G8xtlIObMIUOV9Fz9L1aE2JVH8ldMKwbu2Tcmj5_0y4,123
|
|
2
|
+
gluex_lumi/__init__.pyi,sha256=T_d8pfoT6kzVfY3u0IkdOod0nj6RvgoqzmOacCqccyA,1094
|
|
3
|
+
gluex_lumi/gluex_lumi.abi3.so,sha256=nrvYmqJb5UetJgBUKKF5eZhwR2Hw29u9lFajeGRD3vg,4357112
|
|
4
|
+
gluex_lumi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
gluex_lumi-0.1.3.dist-info/METADATA,sha256=yb4Z98yCDCG7Tw4fM9fltCMk2qhd7hQQdL_-HWNRXwg,2515
|
|
6
|
+
gluex_lumi-0.1.3.dist-info/WHEEL,sha256=DXMOaY2lz3w9wym7AwU59JL7in2Qxv3Lir_p1J8ixdE,139
|
|
7
|
+
gluex_lumi-0.1.3.dist-info/entry_points.txt,sha256=zvGv9pN2XpOzRnWHUH2aRvXYDnkGnlqKCLRiIXXwDiA,44
|
|
8
|
+
gluex_lumi-0.1.3.dist-info/RECORD,,
|