mccode-plumber 0.15.0__py3-none-any.whl → 0.16.0__py3-none-any.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.
@@ -7,6 +7,7 @@ list of EPICS PVs to monitor.
7
7
  Alternatively, the same functionality can be accessed from Python using the configure_forwarder and reset_forwarder
8
8
  functions. Which take PV information and Forwarder/Kafka configuration as arguments.
9
9
  """
10
+ from mccode_antlr.common import InstrumentParameter
10
11
 
11
12
 
12
13
  def normalise_pvs(pvs: list[dict], config=None, prefix=None, topic=None):
@@ -59,10 +60,19 @@ def reset_forwarder(pvs: list[dict], config=None, prefix=None, topic=None):
59
60
  return pvs
60
61
 
61
62
 
62
- def forwarder_partial_streams(prefix, topic, parameters):
63
- names = [p.name for p in parameters]
64
- if 'mcpl_filename' not in names:
65
- names.append("mcpl_filename")
63
+ def forwarder_partial_streams(prefix: str, topic: str, parameters: list[InstrumentParameter]):
64
+ from mccode_antlr.common import DataType
65
+ # The streaming-data-type f144 only supports numeric data, so we need to
66
+ # filter out string-valued data types to avoid annoying error messages in the
67
+ # forwarder's log output.
68
+ names = [p.name for p in parameters if p.value.data_type is not DataType.str]
69
+
70
+ # splitrun adds an instrument parameter named 'mcpl_filename', but we also
71
+ # can not forward this since it is a string-valued parameter.
72
+ #
73
+ #if 'mcpl_filename' not in names:
74
+ # names.append("mcpl_filename")
75
+
66
76
  # Minimal information used by the forwarder for stream setup:
67
77
  partial = [dict(source=f'{prefix}{n}', module='f144', topic=topic) for n in names]
68
78
  return partial
mccode_plumber/writer.py CHANGED
@@ -311,8 +311,16 @@ def construct_writer_pv_dicts(instr: Path | str, prefix: str, topic: str):
311
311
 
312
312
 
313
313
  def construct_writer_pv_dicts_from_parameters(parameters, prefix: str, topic: str):
314
+ from mccode_antlr.common import DataType
315
+
314
316
  def strip_quotes(s):
315
317
  return s[1:-1] if s is not None and len(s) > 2 and (s[0] == s[-1] == '"' or s[0] == s[-1] == "'") else s
318
+
319
+ # Remove string-valued parameters from the provided list since they are not
320
+ # supported by streaming-data-type f144. In the future we could specify a different
321
+ # module for them instead.
322
+ parameters = [p for p in parameters if p.value.data_type is not DataType.str]
323
+
316
324
  return [dict(name=p.name, dtype=p.value.data_type.name, source=f'{prefix}{p.name}', topic=topic,
317
325
  description=parameter_description(p), module='f144', unit=strip_quotes(p.unit)) for p in parameters]
318
326
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mccode-plumber
3
- Version: 0.15.0
3
+ Version: 0.16.0
4
4
  Author-email: Gregory Tucker <gregory.tucker@ess.eu>
5
5
  Classifier: License :: OSI Approved :: BSD License
6
6
  Classifier: Programming Language :: Python :: 3
@@ -12,9 +12,9 @@ Description-Content-Type: text/markdown
12
12
  Requires-Dist: p4p
13
13
  Requires-Dist: kafka-python>=2.2.11
14
14
  Requires-Dist: ess-streaming-data-types>=0.14.0
15
- Requires-Dist: restage>=0.10.0
15
+ Requires-Dist: restage>=0.10.1
16
16
  Requires-Dist: mccode-to-kafka>=0.3.1
17
- Requires-Dist: moreniius>=0.6.2
17
+ Requires-Dist: moreniius>=0.6.3
18
18
  Requires-Dist: icecream
19
19
  Requires-Dist: ephemeral-port-reserve
20
20
  Provides-Extra: test
@@ -2,12 +2,12 @@ mccode_plumber/__init__.py,sha256=ZQMwyPQ6GyoEkKXj7aWETPqhXfwUbDOD5EpvlXj1c18,14
2
2
  mccode_plumber/conductor.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  mccode_plumber/epics.py,sha256=BqkT4A0i1VRMshZU-L0NlJy3BoVDcpHkoKm6gnVB4C8,6217
4
4
  mccode_plumber/epics_watcher.py,sha256=Jiz761A5NfoUzJ6ZzBGg8_BewFTmHDo5qYgh_DZHx_4,3973
5
- mccode_plumber/forwarder.py,sha256=yzjb--r8M6vNSsWvvOi5IjXqpRn8MvT13cv89ezNEeU,3994
5
+ mccode_plumber/forwarder.py,sha256=Nccjof4GydaZLFyk_Ij9xBXy8QUpGigOV6lOPGw0PAQ,4513
6
6
  mccode_plumber/kafka.py,sha256=1BVTsGmiFJPkl-5RVJbkLm68AKRCp2NyngPjMcSutBs,2501
7
7
  mccode_plumber/mccode.py,sha256=vc4Gb5WhdOfuDRjEejU3Flps0C2A60sfFbMrxmKLhn0,2189
8
8
  mccode_plumber/splitrun.py,sha256=E9O88_GnoZ6vdmtgqW2kcHhg0ytJ_FH-oQDtMbSzbAI,2067
9
9
  mccode_plumber/utils.py,sha256=E8NoGo_3Z-pPEpzicVGSWfQOX8p3eR-GxElT33-kX5U,2167
10
- mccode_plumber/writer.py,sha256=10Y6r6s9oXWM76HYJcBSW_a0em-l_E9WJ8y22vn_-JA,21240
10
+ mccode_plumber/writer.py,sha256=uNU1nICANNbB-gTa2WKptfls6tzmoHkUIdzmIeaFWXE,21569
11
11
  mccode_plumber/file_writer_control/CommandChannel.py,sha256=Ge5O71tZqpPmgcyYVcQe6XnxkE9r71Tf3he1ndvOFlQ,9038
12
12
  mccode_plumber/file_writer_control/CommandHandler.py,sha256=LAmr6SpriPfVJd6C38XZ2TsSoO2Dh0iSIzyo8Q3gfrc,2376
13
13
  mccode_plumber/file_writer_control/CommandStatus.py,sha256=acvS-KTH4hYD4xNw3i3FX0d4IukheWvKBmZ--rh1aj0,4536
@@ -29,8 +29,8 @@ mccode_plumber/manage/forwarder.py,sha256=stDKEVVfepCOqs5vBCVepaO3d63KJT-6okxooI
29
29
  mccode_plumber/manage/manager.py,sha256=hkvtH-brtn1IXQB6vN9VB1UF95nSrs48uiIebS48wJI,3876
30
30
  mccode_plumber/manage/orchestrate.py,sha256=Xqu0mm1eBzwf_pRYJzomk0YtnRtlBeQE5dvw78IuqiE,17985
31
31
  mccode_plumber/manage/writer.py,sha256=SEv1U14L01Y9-BcaJKPei4Ah2LFfwexDy9FTjpvtSEs,2245
32
- mccode_plumber-0.15.0.dist-info/METADATA,sha256=tfUoyk7jDp64bf8zP7x-NXjda-ybU7RZYJa6Dkstzj0,957
33
- mccode_plumber-0.15.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
- mccode_plumber-0.15.0.dist-info/entry_points.txt,sha256=k3LDo_9HG2v4-IgMYlNukphdMmaAT6zkJZYaB1zJh3c,900
35
- mccode_plumber-0.15.0.dist-info/top_level.txt,sha256=kCCIpYtKHCKWxiPEqX9J1UaGEm-ze0Qb-cemBCEPhDA,15
36
- mccode_plumber-0.15.0.dist-info/RECORD,,
32
+ mccode_plumber-0.16.0.dist-info/METADATA,sha256=fRIadyUywJuKm7sw9etWeJLdFCHA89IzpPFjlBK4ncM,957
33
+ mccode_plumber-0.16.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
+ mccode_plumber-0.16.0.dist-info/entry_points.txt,sha256=k3LDo_9HG2v4-IgMYlNukphdMmaAT6zkJZYaB1zJh3c,900
35
+ mccode_plumber-0.16.0.dist-info/top_level.txt,sha256=kCCIpYtKHCKWxiPEqX9J1UaGEm-ze0Qb-cemBCEPhDA,15
36
+ mccode_plumber-0.16.0.dist-info/RECORD,,