gluex-rcdb 0.1.3__pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.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_rcdb/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ from .gluex_rcdb import *
2
+
3
+ __doc__ = gluex_rcdb.__doc__
4
+ if hasattr(gluex_rcdb, "__all__"):
5
+ __all__ = gluex_rcdb.__all__
@@ -0,0 +1,129 @@
1
+ from typing import Any, Sequence
2
+ from datetime import datetime
3
+
4
+ class Expr:
5
+ def __invert__(self) -> Expr: ...
6
+
7
+ class RCDB:
8
+ def __init__(self, path: str) -> None: ...
9
+ @property
10
+ def connection_path(self) -> str: ...
11
+ def fetch(
12
+ self,
13
+ condition_names: Sequence[str],
14
+ *,
15
+ run_period: str | None = None,
16
+ runs: Sequence[int] | None = None,
17
+ run_min: int | None = None,
18
+ run_max: int | None = None,
19
+ filters: Expr | Sequence[Expr] | None = None,
20
+ ) -> dict[int, dict[str, Any]]: ...
21
+ def fetch_runs(
22
+ self,
23
+ *,
24
+ run_period: str | None = None,
25
+ runs: Sequence[int] | None = None,
26
+ run_min: int | None = None,
27
+ run_max: int | None = None,
28
+ filters: Expr | Sequence[Expr] | None = None,
29
+ ) -> list[int]: ...
30
+
31
+ class IntCondition:
32
+ def eq(self, value: int) -> Expr: ...
33
+ def ne(self, value: int) -> Expr: ...
34
+ def gt(self, value: int) -> Expr: ...
35
+ def ge(self, value: int) -> Expr: ...
36
+ def lt(self, value: int) -> Expr: ...
37
+ def le(self, value: int) -> Expr: ...
38
+
39
+ class FloatCondition:
40
+ def eq(self, value: float) -> Expr: ...
41
+ def gt(self, value: float) -> Expr: ...
42
+ def ge(self, value: float) -> Expr: ...
43
+ def lt(self, value: float) -> Expr: ...
44
+ def le(self, value: float) -> Expr: ...
45
+
46
+ class StringCondition:
47
+ def eq(self, value: str) -> Expr: ...
48
+ def ne(self, value: str) -> Expr: ...
49
+ def isin(self, values: Sequence[str]) -> Expr: ...
50
+ def contains(self, value: str) -> Expr: ...
51
+
52
+ class BoolCondition:
53
+ def is_true(self) -> Expr: ...
54
+ def is_false(self) -> Expr: ...
55
+ def exists(self) -> Expr: ...
56
+
57
+ class TimeCondition:
58
+ def eq(self, value: datetime) -> Expr: ...
59
+ def gt(self, value: datetime) -> Expr: ...
60
+ def ge(self, value: datetime) -> Expr: ...
61
+ def lt(self, value: datetime) -> Expr: ...
62
+ def le(self, value: datetime) -> Expr: ...
63
+
64
+ def int_cond(name: str) -> IntCondition: ...
65
+ def float_cond(name: str) -> FloatCondition: ...
66
+ def string_cond(name: str) -> StringCondition: ...
67
+ def bool_cond(name: str) -> BoolCondition: ...
68
+ def time_cond(name: str) -> TimeCondition: ...
69
+ def all(*exprs: Expr) -> Expr: ...
70
+ def any(*exprs: Expr) -> Expr: ...
71
+
72
+ class Aliases:
73
+ @property
74
+ def is_production(self) -> Expr: ...
75
+ @property
76
+ def is_2018production(self) -> Expr: ...
77
+ @property
78
+ def is_primex_production(self) -> Expr: ...
79
+ @property
80
+ def is_dirc_production(self) -> Expr: ...
81
+ @property
82
+ def is_src_production(self) -> Expr: ...
83
+ @property
84
+ def is_cpp_production(self) -> Expr: ...
85
+ @property
86
+ def is_production_long(self) -> Expr: ...
87
+ @property
88
+ def is_cosmic(self) -> Expr: ...
89
+ @property
90
+ def is_empty_target(self) -> Expr: ...
91
+ @property
92
+ def is_amorph_radiator(self) -> Expr: ...
93
+ @property
94
+ def is_coherent_beam(self) -> Expr: ...
95
+ @property
96
+ def is_field_off(self) -> Expr: ...
97
+ @property
98
+ def is_field_on(self) -> Expr: ...
99
+ @property
100
+ def status_calibration(self) -> Expr: ...
101
+ @property
102
+ def status_approved_long(self) -> Expr: ...
103
+ @property
104
+ def status_approved(self) -> Expr: ...
105
+ @property
106
+ def status_unchecked(self) -> Expr: ...
107
+ @property
108
+ def status_reject(self) -> Expr: ...
109
+ def approved_production(self, run_period: str) -> Expr: ...
110
+
111
+ aliases: Aliases
112
+
113
+ __all__ = [
114
+ "RCDB",
115
+ "IntCondition",
116
+ "FloatCondition",
117
+ "StringCondition",
118
+ "BoolCondition",
119
+ "TimeCondition",
120
+ "Expr",
121
+ "int_cond",
122
+ "float_cond",
123
+ "string_cond",
124
+ "bool_cond",
125
+ "time_cond",
126
+ "all",
127
+ "any",
128
+ "aliases",
129
+ ]
gluex_rcdb/py.typed ADDED
File without changes
@@ -0,0 +1,58 @@
1
+ Metadata-Version: 2.4
2
+ Name: gluex-rcdb
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: pytest ; extra == 'tests'
16
+ Provides-Extra: tests
17
+ Summary: Python bindings for the GlueX Run Condition Database
18
+ Keywords: gluex,rcdb,sqlite,conditions
19
+ Home-Page: https://github.com/denehoffman/gluex-rs
20
+ Author-email: Nathaniel Dene Hoffman <dene@cmu.edu>
21
+ License: Apache-2.0 OR MIT
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+ Project-URL: Documentation, https://github.com/denehoffman/gluex-rs/tree/main/crates/gluex-rcdb-py
25
+ Project-URL: Homepage, https://github.com/denehoffman/gluex-rs
26
+ Project-URL: Issues, https://github.com/denehoffman/gluex-rs/issues
27
+ Project-URL: Repository, https://github.com/denehoffman/gluex-rs
28
+
29
+ # gluex-rcdb (Python)
30
+
31
+ Python bindings for the `gluex-rcdb` crate. This library provides a simple interface for loading run conditions from RCDB which match the given context (run numbers and filters). It also provides common aliases used to determine production data.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ uv pip install gluex-rcdb
37
+ ```
38
+
39
+ ## Example
40
+
41
+ ```python
42
+ import gluex_rcdb as rcdb
43
+
44
+ client = rcdb.RCDB("/data/rcdb.sqlite")
45
+ filters = rcdb.all(
46
+ rcdb.float_cond("polarization_angle").gt(90.0),
47
+ rcdb.aliases.is_production,
48
+ )
49
+ run_list = client.fetch_runs(run_min=55_000, run_max=55_020, filters=filters)
50
+ values = client.fetch(["polarization_direction", "polarization_angle"], runs=run_list)
51
+ for run, payload in values.items():
52
+ print(run, float(payload["polarization_direction"]))
53
+ ```
54
+
55
+ ## License
56
+
57
+ Dual-licensed under Apache-2.0 or MIT.
58
+
@@ -0,0 +1,7 @@
1
+ gluex_rcdb/__init__.py,sha256=85iABlMeKyHUSeKp4Vv4y-JmuboWLmKMyq9-a8R_uPY,123
2
+ gluex_rcdb/__init__.pyi,sha256=rvaJ9Z7Xyddw9i4lHEsiZGFxlwKPSIIseY9vEvIVRAw,3663
3
+ gluex_rcdb/gluex_rcdb.pypy311-pp73-aarch64-linux-gnu.so,sha256=SrVOwHkQZcqo6xVXko7UbhNCL-V_MIibmpJVsdkwyIE,2845464
4
+ gluex_rcdb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ gluex_rcdb-0.1.3.dist-info/METADATA,sha256=qoTyjufDU5_65Q6OywI7Aw_Rydabi9sr3WMvmihPcUQ,2168
6
+ gluex_rcdb-0.1.3.dist-info/WHEEL,sha256=lvTdq2g8minGuOELGjpnOe0IufZy6sC9B2wysIpb14o,163
7
+ gluex_rcdb-0.1.3.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.11.5)
3
+ Root-Is-Purelib: false
4
+ Tag: pp311-pypy311_pp73-manylinux_2_17_aarch64
5
+ Tag: pp311-pypy311_pp73-manylinux2014_aarch64