pipeline-eds 0.2.22__py3-none-any.whl → 0.2.24__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/cli.py CHANGED
@@ -154,15 +154,15 @@ def trend(
154
154
  queries_manager = QueriesManager(wm)
155
155
  dt_start = queries_manager.get_most_recent_successful_timestamp(api_id=zd)
156
156
  else:
157
- dt_start = pendulum.parse(starttime, strict=False)
157
+ dt_start = pendulum.parse(helpers.sanitize_date_input(starttime), strict=False)
158
158
  if endtime is None:
159
159
  dt_finish = helpers.get_now_time_rounded(wm)
160
160
  else:
161
- dt_finish = pendulum.parse(endtime, strict=False)
161
+ dt_finish = pendulum.parse(helpers.sanitize_date_input(endtime), strict=False)
162
162
 
163
163
  # Should automatically choose time step granularity based on time length; map
164
164
  if step_seconds is None:
165
- step_seconds = helpers.nice_step(TimeManager(dt_finish).as_unix()-TimeManager(dt_start.as_unix())) # TimeManager(starttime).as_unix()
165
+ step_seconds = helpers.nice_step(TimeManager(dt_finish).as_unix()-TimeManager(dt_start).as_unix()) # TimeManager(starttime).as_unix()
166
166
  results = load_historic_data(session, iess_list, dt_start, dt_finish, step_seconds)
167
167
  if not results:
168
168
  return
pipeline/helpers.py CHANGED
@@ -6,6 +6,7 @@ import types
6
6
  import os
7
7
  import logging
8
8
  import socket
9
+ import re
9
10
 
10
11
  from pipeline.time_manager import TimeManager
11
12
 
@@ -120,6 +121,20 @@ def nice_step(delta_sec: int) -> int:
120
121
  if n >= target_step:
121
122
  return n
122
123
  return nice_numbers[-1]
124
+
125
+
126
+
127
+ def sanitize_date_input(date_str: str) -> str:
128
+ '''Sanitize date input strings by adding spaces where needed, to overcome error in fuzzy date parsing by the pendulum library.'''
129
+ # 1. Add space between letters and numbers
130
+ date_str = re.sub(r'([A-Za-z])(\d)', r'\1 \2', date_str)
131
+ # 2. Ensure a space after commas
132
+ date_str = re.sub(r',\s*', ', ', date_str)
133
+ # 3. Normalize multiple spaces
134
+ date_str = re.sub(r'\s+', ' ', date_str).strip()
135
+ return date_str
123
136
 
124
137
  if __name__ == "__main__":
125
- function_view()
138
+ function_view()
139
+ # Example
140
+ sanitize_date_input("December12,2024") # -> "December 12,2024"
@@ -3,7 +3,22 @@ import toml
3
3
  import logging
4
4
  from pathlib import Path
5
5
  import sys
6
- import mulch
6
+ #import mulch
7
+ import importlib.util
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ # current_dir = this pipeline repo
12
+ repo_root = Path(__file__).resolve().parents[3] # adjust if needed
13
+ mulch_path = repo_root / "mulch" / "src" / "mulch" / "__init__.py"
14
+
15
+ if not mulch_path.exists():
16
+ raise FileNotFoundError(f"Expected mulch at {mulch_path}")
17
+
18
+ spec = importlib.util.spec_from_file_location("mulch", str(mulch_path))
19
+ mulch = importlib.util.module_from_spec(spec)
20
+ sys.modules["mulch"] = mulch
21
+ spec.loader.exec_module(mulch)
7
22
 
8
23
  '''
9
24
  Goal:
@@ -313,7 +328,7 @@ class WorkspaceManager:
313
328
  pass
314
329
  #default_file.write_text("# Default workspace config\n")
315
330
  mulch_scaffold = []
316
- mulch.seed(target_dir = workspaces_dir,scaffold_dict = mulch_scaffold)
331
+ mulch.seed(target_dir = workspaces_dir,scaffold_dict = mulch_scaffold, skip_if_exists=True)
317
332
  workspace_path = workspaces_dir / "eds"
318
333
  mulch.workspace(base_path = workspaces_dir.parent, scaffold_filepath = workspaces_dir / '.mulch' / 'mulch.toml', workspace_path = workspace_path) # allow date based default if no workspace_name is provided
319
334
  return workspaces_dir
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pipeline-eds
3
- Version: 0.2.22
3
+ Version: 0.2.24
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
@@ -15,7 +15,7 @@ Provides-Extra: windb
15
15
  Requires-Dist: certifi (>=2025.1.31,<2026.0.0)
16
16
  Requires-Dist: fastapi (>=0.116.1,<0.117.0)
17
17
  Requires-Dist: matplotlib (>=3.10.6,<4.0.0)
18
- Requires-Dist: mulch (==0.2.58)
18
+ Requires-Dist: mulch (>=0.2.62,<0.3.0)
19
19
  Requires-Dist: mysql-connector-python (>=9.3.0,<10.0.0)
20
20
  Requires-Dist: pendulum (>=3.1.0,<4.0.0)
21
21
  Requires-Dist: plotly (>=6.2.0,<7.0.0)
@@ -5,7 +5,7 @@ pipeline/api/eds.py,sha256=O6kHH9KsBKIXiLrT0Cj84g_UUIhjlK8vPPJbG2MP0DU,45087
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=KRn68XZ708GTRw-JB3fUbLAtSFulbpgFDTvXNfoXsHg,11899
8
+ pipeline/cli.py,sha256=o8DP1npD3dxgt043tEbf19RFHpMoT9fAcd8SBo8getA,11957
9
9
  pipeline/configrationmanager.py,sha256=UPqa91117jNm59vvTBE7sET1ThisqRf6B2Dhtk7x9tM,624
10
10
  pipeline/decorators.py,sha256=5fIIVqxSvQFaSI4ZkqPd3yqajzDxaRhgYwlC1jD2k5A,411
11
11
  pipeline/env.py,sha256=aVYssr6b5fVXt1GxehloyOv7fbRmuUzSQ7uQz4zwI_0,1926
@@ -13,7 +13,7 @@ pipeline/environment.py,sha256=ABXv5DAWW0EGrnE27dJNkj_aKmyD6e84RDSMyW1qKzE,1523
13
13
  pipeline/gui_fastapi_plotly_live.py,sha256=bje-W93yWb7G7A5H7Rg7BgNpfV_fjxhbl7x7zwkUCXc,3246
14
14
  pipeline/gui_mpl_live.py,sha256=JLh2YWK2SwGykik7mC_HfNMVzVVYymoEnwzSB7VHrIk,4286
15
15
  pipeline/gui_plotly_static.py,sha256=wUNTjLqsuldWRYu65w5-HDco4201FKAO5esMe2NOras,1133
16
- pipeline/helpers.py,sha256=-GGFz5t22wlFfHwtEDwWOBslzguLXXSYNzxxRBvclLI,4457
16
+ pipeline/helpers.py,sha256=8tbg0EB_7Jg3oFJxvPmb0n1QtOdqa4zIogEIOuJM2ko,5050
17
17
  pipeline/install_appdata.py,sha256=DGemGRogMVAmFzqSKladfxgLQOslIHyul2Xxq34do8A,2814
18
18
  pipeline/logging_setup.py,sha256=CAqWfchscCdzJ63Wf1dC3QGRnFnQqBELxyTmPZxsxgs,1674
19
19
  pipeline/pastehelpers.py,sha256=pkmtULW5Zk_-ffUDDp_VsGzruIjsNB1xAIPbb9jtofE,265
@@ -22,7 +22,7 @@ pipeline/plotbuffer.py,sha256=jCsFbT47TdR8Sq5tjj2JdhVELjRiebLPN7O4r2LjPeY,625
22
22
  pipeline/points_loader.py,sha256=4OCGLiatbP3D5hixVnYcFGThvBRYt_bf5DhNGdGw_9k,519
23
23
  pipeline/queriesmanager.py,sha256=iQRPZDnllhQ4_nI7764SgUCxA0Wy5-cA32y-7tR5vBE,5011
24
24
  pipeline/time_manager.py,sha256=gSK430SyHvhgUWLRg_z2nBiyad01v7ByyKafB138IkU,8351
25
- pipeline/workspace_manager.py,sha256=cpBecFipE7f1_xTxiE9jmQ7U7Nnk6Ovg22lxlchnzI8,15335
25
+ pipeline/workspace_manager.py,sha256=_5NwwD6vF9XthoFAiY3COwBcZ_ZcDcxrq962kwkAIDk,15872
26
26
  workspaces/default-workspace.toml,sha256=dI8y2l2WlEbIck6IZpbuQUP8-Bf48bBE1CKKsnVMc8w,300
27
27
  workspaces/eds_to_rjn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  workspaces/eds_to_rjn/code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -57,8 +57,8 @@ workspaces/eds_to_rjn/scripts/daemon_runner.py,sha256=gBCYrJ-FYPCTt_l5O07_YNrrGj
57
57
  workspaces/eds_to_rjn/secrets/README.md,sha256=tWf2bhopA0C08C8ImtHNZoPde9ub-sLMjX6EMe7lyJw,600
58
58
  workspaces/eds_to_rjn/secrets/secrets-example.yaml,sha256=qKGrKsKBC0ulDQRVbr1zkfNlr8WPWK4lg5GAvTqZ-T4,365
59
59
  workspaces/eds_to_termux/..txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
- pipeline_eds-0.2.22.dist-info/entry_points.txt,sha256=jmU0FQ7-2AHXhKcj4TXPn61xLbHlycHA2lkDlRZT-pg,124
61
- pipeline_eds-0.2.22.dist-info/LICENSE,sha256=LKdx0wS1t9vFZpbRhDg_iLQ6ny-XsXRwhKAoCfrF6iA,1501
62
- pipeline_eds-0.2.22.dist-info/METADATA,sha256=l-zeLOv48wC5ceym6O7c_f0lIULO1QJOb0cPv6Ocxfo,10021
63
- pipeline_eds-0.2.22.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
64
- pipeline_eds-0.2.22.dist-info/RECORD,,
60
+ pipeline_eds-0.2.24.dist-info/entry_points.txt,sha256=jmU0FQ7-2AHXhKcj4TXPn61xLbHlycHA2lkDlRZT-pg,124
61
+ pipeline_eds-0.2.24.dist-info/LICENSE,sha256=LKdx0wS1t9vFZpbRhDg_iLQ6ny-XsXRwhKAoCfrF6iA,1501
62
+ pipeline_eds-0.2.24.dist-info/METADATA,sha256=hYReh3SL6rhx91IV0WXzCfD1faKLIXPOs3d06TwvHbo,10028
63
+ pipeline_eds-0.2.24.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
64
+ pipeline_eds-0.2.24.dist-info/RECORD,,