legend-dataflow-scripts 0.3.0a1__tar.gz → 0.3.0a2__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.
Files changed (44) hide show
  1. {legend_dataflow_scripts-0.3.0a1/src/legend_dataflow_scripts.egg-info → legend_dataflow_scripts-0.3.0a2}/PKG-INFO +1 -1
  2. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2/src/legend_dataflow_scripts.egg-info}/PKG-INFO +1 -1
  3. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/_version.py +3 -3
  4. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/evtsel.py +7 -0
  5. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/tier/dsp.py +6 -0
  6. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/utils/log.py +38 -4
  7. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/LICENSE +0 -0
  8. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/README.md +0 -0
  9. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/pyproject.toml +0 -0
  10. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/setup.cfg +0 -0
  11. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legend_dataflow_scripts.egg-info/SOURCES.txt +0 -0
  12. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legend_dataflow_scripts.egg-info/dependency_links.txt +0 -0
  13. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legend_dataflow_scripts.egg-info/entry_points.txt +0 -0
  14. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legend_dataflow_scripts.egg-info/not-zip-safe +0 -0
  15. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legend_dataflow_scripts.egg-info/requires.txt +0 -0
  16. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legend_dataflow_scripts.egg-info/top_level.txt +0 -0
  17. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/__init__.py +0 -0
  18. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/__init__.py +0 -0
  19. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/__init__.py +0 -0
  20. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/__init__.py +0 -0
  21. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/dplms.py +0 -0
  22. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/eopt.py +0 -0
  23. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/nopt.py +0 -0
  24. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/pz.py +0 -0
  25. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/svm.py +0 -0
  26. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/dsp/svm_build.py +0 -0
  27. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/hit/__init__.py +0 -0
  28. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/hit/aoe.py +0 -0
  29. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/hit/ecal.py +0 -0
  30. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/hit/lq.py +0 -0
  31. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/par/geds/hit/qc.py +0 -0
  32. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/tier/__init__.py +0 -0
  33. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/tier/hit.py +0 -0
  34. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/utils/__init__.py +0 -0
  35. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/utils/alias_table.py +0 -0
  36. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/utils/cfgtools.py +0 -0
  37. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/utils/convert_np.py +0 -0
  38. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/utils/plot_dict.py +0 -0
  39. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/utils/pulser_removal.py +0 -0
  40. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/workflow/__init__.py +0 -0
  41. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/workflow/execenv.py +0 -0
  42. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/workflow/filedb.py +0 -0
  43. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/workflow/pre_compile_catalog.py +0 -0
  44. {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a2}/src/legenddataflowscripts/workflow/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: legend-dataflow-scripts
3
- Version: 0.3.0a1
3
+ Version: 0.3.0a2
4
4
  Summary: Python package for the processing scripts for LEGEND-200 data
5
5
  Author-email: George Marshall <ggmarsh@uw.edu>, Luigi Pertoldi <gipert@pm.me>
6
6
  Maintainer: The LEGEND Collaboration
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: legend-dataflow-scripts
3
- Version: 0.3.0a1
3
+ Version: 0.3.0a2
4
4
  Summary: Python package for the processing scripts for LEGEND-200 data
5
5
  Author-email: George Marshall <ggmarsh@uw.edu>, Luigi Pertoldi <gipert@pm.me>
6
6
  Maintainer: The LEGEND Collaboration
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.3.0a1'
32
- __version_tuple__ = version_tuple = (0, 3, 0, 'a1')
31
+ __version__ = version = '0.3.0a2'
32
+ __version_tuple__ = version_tuple = (0, 3, 0, 'a2')
33
33
 
34
- __commit_id__ = commit_id = 'gc8848acbc'
34
+ __commit_id__ = commit_id = 'ge15d92d11'
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import argparse
4
4
  import json
5
+ import sys
5
6
  import time
6
7
  import warnings
7
8
  from bisect import bisect_left
@@ -99,6 +100,12 @@ def par_geds_dsp_evtsel() -> None:
99
100
  required=False,
100
101
  )
101
102
 
103
+ argparser.add_argument(
104
+ "--channel",
105
+ type=str,
106
+ help="Channel to process; required if --raw-cal-curve is set",
107
+ required="--raw-cal-curve" in sys.argv,
108
+ )
102
109
  argparser.add_argument("--log", help="log_file", type=str)
103
110
 
104
111
  argparser.add_argument(
@@ -95,6 +95,8 @@ def build_tier_dsp() -> None:
95
95
  # check if the raw tables are all existing
96
96
  if len(lh5.ls(args.input, input_tbl_name)) > 0:
97
97
  dsp_cfg_tbl_dict[input_tbl_name] = Props.read_from(file)
98
+ msg = f"found table {input_tbl_name} in {args.input}"
99
+ log.debug(msg)
98
100
  else:
99
101
  msg = f"table {input_tbl_name} not found in {args.input} skipping"
100
102
  log.info(msg)
@@ -147,6 +149,8 @@ def build_tier_dsp() -> None:
147
149
  kwargs = {
148
150
  "raw_in": args.input,
149
151
  "dsp_out": dsp_files[i],
152
+ "lh5_tables": list(config.keys()),
153
+ "base_group": "",
150
154
  "chan_config": config,
151
155
  "database": database_dict,
152
156
  "write_mode": "r",
@@ -173,6 +177,8 @@ def build_tier_dsp() -> None:
173
177
  build_dsp(
174
178
  raw_in=args.input,
175
179
  dsp_out=args.output,
180
+ lh5_tables=list(dsp_cfg_tbl_dict.keys()),
181
+ base_group="",
176
182
  database=database_dict,
177
183
  chan_config=dsp_cfg_tbl_dict,
178
184
  write_mode="r",
@@ -26,7 +26,7 @@ class StreamToLogger:
26
26
 
27
27
 
28
28
  def build_log(
29
- config_dict: dict, log_file: str | None = None, fallback: str = "prod"
29
+ config_dict: dict | str, log_file: str | None = None, fallback: str = "prod"
30
30
  ) -> logging.Logger:
31
31
  """Build a logger from a configuration dictionary.
32
32
 
@@ -39,10 +39,22 @@ def build_log(
39
39
  log_file
40
40
  The path to the log file.
41
41
  """
42
- if isinstance(config_dict, str | dict):
42
+ # Accept either:
43
+ # - a str pointing to a logging properties file
44
+ # - a plain logging dict (handlers/formatters/etc.)
45
+ # - a dict already containing "options" -> {"logging": ...}
46
+ # If a dict is provided and it already contains an "options" key, assume
47
+ # caller set options explicitly (so we must not wrap it).
48
+ if isinstance(config_dict, str) or (
49
+ isinstance(config_dict, dict) and "options" not in config_dict
50
+ ):
43
51
  config_dict = {"options": {"logging": config_dict}}
44
52
 
45
- if "logging" in config_dict["options"]:
53
+ if (
54
+ isinstance(config_dict, dict)
55
+ and "options" in config_dict
56
+ and "logging" in config_dict["options"]
57
+ ):
46
58
  log_config = config_dict["options"]["logging"]
47
59
  # if it's a str, interpret it as a path to a file
48
60
  if isinstance(log_config, str):
@@ -50,7 +62,29 @@ def build_log(
50
62
 
51
63
  if log_file is not None:
52
64
  Path(log_file).parent.mkdir(parents=True, exist_ok=True)
53
- log_config["handlers"]["dataflow"]["filename"] = log_file
65
+ # Ensure the logging config has a handlers->dataflow entry; create
66
+ # minimal structure if needed so we can set the filename.
67
+ if isinstance(log_config, dict):
68
+ handlers = log_config.setdefault("handlers", {})
69
+ dataflow = handlers.setdefault("dataflow", {})
70
+ # Set the filename for the dataflow handler
71
+ dataflow["filename"] = log_file
72
+ dataflow.setdefault("class", "logging.FileHandler")
73
+ dataflow.setdefault("level", "INFO")
74
+ log_config.setdefault("version", 1)
75
+ if (
76
+ "handlers" in log_config
77
+ and "dataflow" in log_config["handlers"]
78
+ and "root" not in log_config
79
+ and "loggers" not in log_config
80
+ ):
81
+ dataflow_level = log_config["handlers"]["dataflow"].get(
82
+ "level", "INFO"
83
+ )
84
+ log_config["root"] = {
85
+ "level": dataflow_level,
86
+ "handlers": ["dataflow"],
87
+ }
54
88
 
55
89
  dictConfig(log_config)
56
90
  log = logging.getLogger(config_dict["options"].get("logger", "prod"))