wums 0.1.4__tar.gz → 0.1.5__tar.gz
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.
- {wums-0.1.4 → wums-0.1.5}/PKG-INFO +1 -1
- {wums-0.1.4 → wums-0.1.5}/pyproject.toml +1 -1
- {wums-0.1.4 → wums-0.1.5}/wums/ioutils.py +4 -0
- {wums-0.1.4 → wums-0.1.5}/wums/plot_tools.py +42 -0
- {wums-0.1.4 → wums-0.1.5}/wums.egg-info/PKG-INFO +1 -1
- {wums-0.1.4 → wums-0.1.5}/README.md +0 -0
- {wums-0.1.4 → wums-0.1.5}/setup.cfg +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums/Templates/index.php +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums/__init__.py +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums/boostHistHelpers.py +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums/logging.py +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums/output_tools.py +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums.egg-info/SOURCES.txt +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums.egg-info/dependency_links.txt +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums.egg-info/requires.txt +0 -0
- {wums-0.1.4 → wums-0.1.5}/wums.egg-info/top_level.txt +0 -0
|
@@ -6,6 +6,7 @@ import shutil
|
|
|
6
6
|
import socket
|
|
7
7
|
import sys
|
|
8
8
|
import textwrap
|
|
9
|
+
import importlib
|
|
9
10
|
|
|
10
11
|
import hist
|
|
11
12
|
import matplotlib as mpl
|
|
@@ -1780,3 +1781,44 @@ def make_summary_plot(
|
|
|
1780
1781
|
ax1.xaxis.set_major_locator(ticker.LinearLocator(numticks=5))
|
|
1781
1782
|
|
|
1782
1783
|
return fig
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
def load_config(config_path):
|
|
1787
|
+
if config_path is None:
|
|
1788
|
+
return {}
|
|
1789
|
+
# load a python module
|
|
1790
|
+
spec = importlib.util.spec_from_file_location("config", config_path)
|
|
1791
|
+
config = importlib.util.module_from_spec(spec)
|
|
1792
|
+
spec.loader.exec_module(config)
|
|
1793
|
+
return config
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
def read_axis_label(x, labels, with_unit=True):
|
|
1797
|
+
if x in labels:
|
|
1798
|
+
label = labels[x]
|
|
1799
|
+
if isinstance(label, str):
|
|
1800
|
+
return label
|
|
1801
|
+
elif with_unit:
|
|
1802
|
+
return f'{label["label"]} ({label["unit"]})'
|
|
1803
|
+
else:
|
|
1804
|
+
return label["label"]
|
|
1805
|
+
else:
|
|
1806
|
+
return x
|
|
1807
|
+
|
|
1808
|
+
|
|
1809
|
+
def get_axis_label(config, default_keys=None, label=None, is_bin=False):
|
|
1810
|
+
if label is not None:
|
|
1811
|
+
return label
|
|
1812
|
+
|
|
1813
|
+
if default_keys is None:
|
|
1814
|
+
return "Bin index"
|
|
1815
|
+
|
|
1816
|
+
labels = getattr(config, "axis_labels", {})
|
|
1817
|
+
|
|
1818
|
+
if len(default_keys) == 1:
|
|
1819
|
+
if is_bin:
|
|
1820
|
+
return f"{read_axis_label(default_keys[0], labels, False)} bin"
|
|
1821
|
+
else:
|
|
1822
|
+
return read_axis_label(default_keys[0], labels)
|
|
1823
|
+
else:
|
|
1824
|
+
return f"({', '.join([read_axis_label(a, labels, False) for a in default_keys])}) bin"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|