MNeuEventLib 0.2.1__cp313-cp313-win_amd64.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.
@@ -0,0 +1,2 @@
1
+ # re-export Rust in main namespace
2
+ from MNeuEventLib.core import *
Binary file
@@ -0,0 +1,56 @@
1
+ """Plotting functions for data."""
2
+ from typing import Optional
3
+
4
+ import matplotlib.pyplot as plt
5
+ import numpy as np
6
+
7
+ from MNeuEventLib.core import Data
8
+
9
+ def plot_sample_log(data: Data, log_name: str):
10
+ """
11
+ Plot a sample log.
12
+
13
+ Parameters
14
+ ----------
15
+ data: Data
16
+ The Data object containing the sample log.
17
+ log_name: str
18
+ The name of the sample log to plot.
19
+ """
20
+ sample_log = data.dataset.get_sample_log(log_name)
21
+ fig, ax = plt.subplots()
22
+ ax.set_title(sample_log['name'])
23
+ ax.set_xlabel("Time (seconds)")
24
+ if units := sample_log['unit'] == "":
25
+ unit_string = ""
26
+ else:
27
+ unit_string = f"({units})"
28
+ ax.set_ylabel(f"Value {unit_string}")
29
+ ax.plot(sample_log['time'], sample_log['value'])
30
+
31
+ plt.show()
32
+
33
+ def plot_amplitudes(data: Data, max_height: Optional[float] = None, n_bins: int = 10):
34
+ """
35
+ Plot a histogram of amplitudes.
36
+
37
+ Parameters
38
+ ----------
39
+ data: Data
40
+ The Data object containing the sample log.
41
+ max_height: float, optional
42
+ The maximum height to use.
43
+ Any data above this height will be placed in the last bin.
44
+ If not provided, calculates the maximum amplitude in the data.
45
+ n_bins: int, default 10
46
+ The number of equal-width bins to use.
47
+ """
48
+ # get_amp_histogram returns the histogram and the max height used
49
+ hist, max_h = data.dataset.get_amp_histogram(max_height, n_bins)
50
+
51
+ steps = np.linspace(0, max_h, len(hist)+1)
52
+ fig, ax = plt.subplots()
53
+ ax.stairs(hist, steps, fill = True)
54
+
55
+ plt.show()
56
+
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: MNeuEventLib
3
+ Version: 0.2.1
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
7
+ Requires-Dist: numpy
8
+ Requires-Dist: matplotlib
9
+ Requires-Dist: ipykernel ; extra == 'docs'
10
+ Requires-Dist: nbsphinx ; extra == 'docs'
11
+ Provides-Extra: docs
12
+ License-File: LICENSE
13
+ Summary: Event data filtering library for ISIS Neutron and Muon Source.
14
+ License-Expression: BSD-3-Clause
15
+ Requires-Python: >=3.8
@@ -0,0 +1,8 @@
1
+ MNeuEventLib/__init__.py,sha256=TjE7Yb4lgD9wC8I6Hr5pLT3EZ4vvHj3gSwaCtUB_vd8,69
2
+ MNeuEventLib/core.cp313-win_amd64.pyd,sha256=Uu-TPlBb94pQkT-Cvxkg_hy7dXepUVDV6SNjW7RrrPg,28747264
3
+ MNeuEventLib/plotting.py,sha256=1nlpwBjpofYHgnsSvJB7U6pUp19S1-DYs2QizV7WmTU,1628
4
+ mneueventlib-0.2.1.dist-info/METADATA,sha256=eUx7_5vQwO_Tb3GBg57f0NMdTG-YwGRe7jduKaGpD-8,541
5
+ mneueventlib-0.2.1.dist-info/WHEEL,sha256=s-xaFzw5tWWSSNKn-DuKhiHUeYX5UHiEcnl_hzDJ9ZY,97
6
+ mneueventlib-0.2.1.dist-info/licenses/LICENSE,sha256=gBmiHRiOb3ftcpRW6lgHWs_WmDM8gpCw8E5awzaed04,1543
7
+ mneueventlib-0.2.1.dist-info/sboms/MNeuEventLib.cyclonedx.json,sha256=QiCHRF5VLVJPT8QNPY91suDyjuY6c3ecbjtrd3bnl1g,104549
8
+ mneueventlib-0.2.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.15.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-win_amd64
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, ISIS Neutron and Muon Source
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.