pipeline-eds 0.2.10__py3-none-any.whl → 0.2.12__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.
pipeline/api/eds.py CHANGED
@@ -726,13 +726,8 @@ def demo_eds_webplot_point_live():
726
726
  gui_fastapi_plotly_live.run_gui(data_buffer)
727
727
 
728
728
  @log_function_call(level=logging.DEBUG)
729
- def load_historic_data(queries_manager, workspace_manager, session, iess_list, starttime=None, endtime=None):
730
- if starttime is None:
731
- # back_to_last_success = True
732
- starttime = queries_manager.get_most_recent_successful_timestamp(api_id=zd)
733
-
734
- if endtime is None:
735
- endtime = helpers.get_now_time_rounded(workspace_manager)
729
+ def load_historic_data(session, iess_list, starttime, endtime):
730
+
736
731
 
737
732
  starttime = TimeManager(starttime).as_unix()
738
733
  endtime = TimeManager(endtime).as_unix()
pipeline/cli.py CHANGED
@@ -92,7 +92,7 @@ def trend(
92
92
  starttime: str = typer.Option(None, "--start", "-s", help="Index from 'mulch order' to choose scaffold source."),
93
93
  endtime: str = typer.Option(None, "--end", "-end", help="Reference a known template for workspace organization."),
94
94
  zd: str = typer.Option('Maxson', "--zd", "-z", help = "Define the EDS ZD from your secrets file. This must correlate with your idcs point selection(s)."),
95
- workspace: str = typer.Option(WorkspaceManager.identify_default_workspace_name(),"--workspace","-w", help = "Provide the name of the workspace you want to use, for the secrets.yaml credentials and for the timezone config. If a start time is not provided, the workspace queries can checked for the most recent successful timestamp. ")
95
+ workspace: str = typer.Option(None,"--workspace","-w", help = "Provide the name of the workspace you want to use, for the secrets.yaml credentials and for the timezone config. If a start time is not provided, the workspace queries can checked for the most recent successful timestamp. ")
96
96
  ):
97
97
  """
98
98
  Show a curve for a sensor over time.
@@ -101,11 +101,16 @@ def trend(
101
101
  import pendulum
102
102
  from pipeline.api.eds import EdsClient, load_historic_data
103
103
  from pipeline import helpers
104
- from pipeline.queriesmanager import QueriesManager
105
104
  from pipeline.plotbuffer import PlotBuffer
106
105
  from pipeline import gui_fastapi_plotly_live
107
106
  from pipeline import environment
108
107
 
108
+ # must set up %appdata for pip/x installation. Use mulch or yeoman for this. And have a secrets filler.
109
+ if workspace is None:
110
+ WorkspaceManager.identify_default_workspace_name()
111
+ wm = WorkspaceManager(workspace)
112
+ secrets_dict = SecretConfig.load_config(secrets_file_path = wm.get_secrets_file_path())
113
+
109
114
  if zd.lower() == "stiles":
110
115
  zd = "WWTF"
111
116
 
@@ -118,20 +123,18 @@ def trend(
118
123
  idcs_to_iess_suffix = ".UNIT0@NET0"
119
124
  iess_list = [x+idcs_to_iess_suffix for x in idcs]
120
125
 
121
-
122
- wm = WorkspaceManager(workspace)
123
- secrets_dict = SecretConfig.load_config(secrets_file_path = wm.get_secrets_file_path())
124
-
125
126
  base_url = secrets_dict.get("eds_apis", {}).get(zd, {}).get("url").rstrip("/")
126
127
  session = EdsClient.login_to_session(api_url = base_url,
127
128
  username = secrets_dict.get("eds_apis", {}).get(zd, {}).get("username"),
128
129
  password = secrets_dict.get("eds_apis", {}).get(zd, {}).get("password"))
129
130
  session.base_url = base_url
130
131
  session.zd = secrets_dict.get("eds_apis", {}).get(zd, {}).get("zd")
131
- queries_manager = QueriesManager(wm)
132
+
132
133
 
133
134
  if starttime is None:
134
135
  # back_to_last_success = True
136
+ from pipeline.queriesmanager import QueriesManager
137
+ queries_manager = QueriesManager(wm)
135
138
  dt_start = queries_manager.get_most_recent_successful_timestamp(api_id=zd)
136
139
  else:
137
140
  dt_start = pendulum.parse(starttime, strict=False)
@@ -142,7 +145,7 @@ def trend(
142
145
 
143
146
  # Should automatically choose time step granularity based on time length; map
144
147
 
145
- results = load_historic_data(queries_manager, wm, session, iess_list, dt_start, dt_finish)
148
+ results = load_historic_data(session, iess_list, dt_start, dt_finish)
146
149
 
147
150
  data_buffer = PlotBuffer()
148
151
  for idx, rows in enumerate(results):
@@ -150,7 +153,7 @@ def trend(
150
153
  label = f"{row.get('rjn_entityid')} ({row.get('units')})"
151
154
  ts = helpers.iso(row.get("ts"))
152
155
  av = row.get("value")
153
- data_buffer.append(label, ts, av)
156
+ data_buffer.append(label, ts, av) # needs to be adapted for multiple iess sensor results
154
157
 
155
158
  if not environment.matplotlib_enabled():
156
159
  gui_fastapi_plotly_live.run_gui(data_buffer)
@@ -158,8 +161,6 @@ def trend(
158
161
  from pipeline import gui_mpl_live
159
162
  gui_mpl_live.run_gui(data_buffer)
160
163
 
161
-
162
-
163
164
  @app.command()
164
165
  def list_workspaces():
165
166
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pipeline-eds
3
- Version: 0.2.10
3
+ Version: 0.2.12
4
4
  Summary: The official API pipeline library for mulch-based projects. Key target: Emerson Ovation EDS REST API.
5
5
  License: BSD-3
6
6
  Author: George Clayton Bennett
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
14
  Provides-Extra: windb
15
15
  Requires-Dist: certifi (>=2025.1.31,<2026.0.0)
16
- Requires-Dist: fastapi (==0.100.0)
16
+ Requires-Dist: fastapi (==0.103.0)
17
17
  Requires-Dist: mulch (>=0.2.8,<0.3.0)
18
18
  Requires-Dist: mysql-connector-python (>=9.3.0,<10.0.0)
19
19
  Requires-Dist: pendulum (>=3.1.0,<4.0.0)
@@ -1,11 +1,11 @@
1
1
  pipeline/__init__.py,sha256=DAy4hBleDDk9Wen4qIOGlS03qWqdt7K7n4rUpL3cIL4,173
2
2
  pipeline/__main__.py,sha256=TtbGYUm7Np5eLPCHZ3iX5QPL0rSgGJ5tXVuBEORvQIE,19
3
3
  pipeline/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- pipeline/api/eds.py,sha256=P-oRQzy1CGqrE2o2oEK1mQMNMZk13o2bWqQBSTFPEuw,43999
4
+ pipeline/api/eds.py,sha256=M7XkSwDKb2wGs5j69yaAS8-5JwGbLfs6uVz70RjG6WQ,43714
5
5
  pipeline/api/rjn.py,sha256=Fhbc3tE_WgUywVJimnLzhWnxyMzGiIUu54hRFR3sdUA,7102
6
6
  pipeline/api/status_api.py,sha256=KJG7e4GXmTjqQxK3LFUcdAxj1jqzvNLJ0f9-tuisk00,202
7
7
  pipeline/calls.py,sha256=FexXJK0_fwgQMPx9dy5eFai_6xqVOsOGoEUw8yP3eSU,4187
8
- pipeline/cli.py,sha256=9pdl8k127IvB9mvmKmhot6DzV2m6egx0VRFSYAaE4x8,10029
8
+ pipeline/cli.py,sha256=72UDPcGxiZfyiIVz1D1fGlL8Z9slH0OsbZG-TsbSFnQ,10221
9
9
  pipeline/configrationmanager.py,sha256=UPqa91117jNm59vvTBE7sET1ThisqRf6B2Dhtk7x9tM,624
10
10
  pipeline/decorators.py,sha256=5fIIVqxSvQFaSI4ZkqPd3yqajzDxaRhgYwlC1jD2k5A,411
11
11
  pipeline/env.py,sha256=Ibs0K_wluUTJXCcBjUofZ1jexks-UmJ0dvbXhWPLdJ0,1922
@@ -55,8 +55,8 @@ workspaces/eds_to_rjn/scripts/daemon_runner.py,sha256=gBCYrJ-FYPCTt_l5O07_YNrrGj
55
55
  workspaces/eds_to_rjn/secrets/README.md,sha256=tWf2bhopA0C08C8ImtHNZoPde9ub-sLMjX6EMe7lyJw,600
56
56
  workspaces/eds_to_rjn/secrets/secrets-example.yaml,sha256=qKGrKsKBC0ulDQRVbr1zkfNlr8WPWK4lg5GAvTqZ-T4,365
57
57
  workspaces/eds_to_termux/..txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- pipeline_eds-0.2.10.dist-info/entry_points.txt,sha256=t1hTaepU6pSowdqa8OSzohoTbmDRLA3Jnp8MfqagwEs,103
59
- pipeline_eds-0.2.10.dist-info/LICENSE,sha256=LKdx0wS1t9vFZpbRhDg_iLQ6ny-XsXRwhKAoCfrF6iA,1501
60
- pipeline_eds-0.2.10.dist-info/METADATA,sha256=m7Bu0vNdVIB31Y8r7u2GkaqwJUF9MFJv8gKwcGjBPpc,9974
61
- pipeline_eds-0.2.10.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
62
- pipeline_eds-0.2.10.dist-info/RECORD,,
58
+ pipeline_eds-0.2.12.dist-info/entry_points.txt,sha256=t1hTaepU6pSowdqa8OSzohoTbmDRLA3Jnp8MfqagwEs,103
59
+ pipeline_eds-0.2.12.dist-info/LICENSE,sha256=LKdx0wS1t9vFZpbRhDg_iLQ6ny-XsXRwhKAoCfrF6iA,1501
60
+ pipeline_eds-0.2.12.dist-info/METADATA,sha256=HFKEtFItZoyZXuw1Uk5cPX-IAr3ze1ekpO48vXiWs5Y,9974
61
+ pipeline_eds-0.2.12.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
62
+ pipeline_eds-0.2.12.dist-info/RECORD,,