aplos-nca-saas-sdk 0.0.23__py3-none-any.whl → 0.0.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.
@@ -9,7 +9,7 @@ import json
9
9
  from typing import Dict, List, Any
10
10
  from pathlib import Path
11
11
  from dotenv import load_dotenv
12
- from aplos_nca_saas_sdk.utilities.file_utility import FileUtility
12
+
13
13
 
14
14
  class EnvironmentServices:
15
15
  """Environment Services"""
@@ -26,9 +26,9 @@ class EnvironmentServices:
26
26
 
27
27
  if not starting_path:
28
28
  starting_path = __file__
29
- fu: FileUtility = FileUtility()
30
29
 
31
- environment_file: str | None = fu.find_file(
30
+
31
+ environment_file: str | None = self.find_file(
32
32
  starting_path=starting_path,
33
33
  file_name=file_name,
34
34
  raise_error_if_not_found=raise_error_if_not_found,
@@ -87,3 +87,33 @@ class EnvironmentServices:
87
87
  )
88
88
 
89
89
  return None
90
+
91
+ def find_file(
92
+ self, starting_path: str, file_name: str, raise_error_if_not_found: bool = True
93
+ ) -> str | None:
94
+ """Searches the project directory structure for a file"""
95
+
96
+ starting_path = starting_path or __file__
97
+ parents = len(starting_path.split(os.sep)) -1
98
+ paths: List[str] = []
99
+ for parent in range(parents):
100
+ try:
101
+ path = Path(starting_path).parents[parent].absolute()
102
+
103
+ tmp = os.path.join(path, file_name)
104
+ paths.append(tmp)
105
+ if os.path.exists(tmp):
106
+ return tmp
107
+ except Exception as e:
108
+ print(f"Error {str(e)}")
109
+ print(f"Failed to find the file: {file_name}.")
110
+ print(f'Searched: {"\n".join(paths)}.')
111
+
112
+
113
+ if raise_error_if_not_found:
114
+ searched_paths = "\n".join(paths)
115
+ raise RuntimeError(
116
+ f"Failed to locate environment file: {file_name} in: \n {searched_paths}"
117
+ )
118
+
119
+ return None
@@ -5,8 +5,6 @@ Property of Aplos Analytics, Utah, USA
5
5
  """
6
6
 
7
7
  import os
8
- from pathlib import Path
9
- from typing import List
10
8
 
11
9
  from aplos_nca_saas_sdk.utilities.environment_services import EnvironmentServices
12
10
 
@@ -39,27 +37,5 @@ class FileUtility:
39
37
  ) -> str | None:
40
38
  """Searches the project directory structure for a file"""
41
39
 
42
- starting_path = starting_path or __file__
43
- parents = len(starting_path.split(os.sep)) -1
44
- paths: List[str] = []
45
- for parent in range(parents):
46
- try:
47
- path = Path(starting_path).parents[parent].absolute()
48
-
49
- tmp = os.path.join(path, file_name)
50
- paths.append(tmp)
51
- if os.path.exists(tmp):
52
- return tmp
53
- except Exception as e:
54
- print(f"Error {str(e)}")
55
- print(f"Failed to find the file: {file_name}.")
56
- print(f'Searched: {"\n".join(path)}.')
57
-
58
-
59
- if raise_error_if_not_found:
60
- searched_paths = "\n".join(paths)
61
- raise RuntimeError(
62
- f"Failed to locate environment file: {file_name} in: \n {searched_paths}"
63
- )
64
-
65
- return None
40
+ es: EnvironmentServices = EnvironmentServices()
41
+ return es.find_file(starting_path, file_name, raise_error_if_not_found)
@@ -1,4 +1,4 @@
1
1
  # Aplos NCA SaaS SDK Version File
2
2
  # This is automatically generated during the build process.
3
3
  # DO NOT UPDATE IT DIRECTLY. IT WILL BE OVERWRITTEN.
4
- __version__ = '0.0.23'
4
+ __version__ = '0.0.24'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aplos_nca_saas_sdk
3
- Version: 0.0.23
3
+ Version: 0.0.24
4
4
  Summary: Aplos NCA SaaS SDK
5
5
  Project-URL: Homepage, https://aplosanalytics.com/
6
6
  Project-URL: Documentation, https://docs.aplosanalytics.com/
@@ -1,6 +1,6 @@
1
1
  aplos_nca_saas_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  aplos_nca_saas_sdk/run_analysis_execution.py,sha256=H425VMCtxIX1vlWac0Wex2CJXVzQQwgv5AGNCpaVqN4,4446
3
- aplos_nca_saas_sdk/version.py,sha256=RAudmyVpGHPDshgqTIVsiJxYPFdyHRiuQlL4vWx4v6c,172
3
+ aplos_nca_saas_sdk/version.py,sha256=VXhxq2KBBxSTjGA5lIw5x1NtuFQBxEFFmPDvlV3AQn0,172
4
4
  aplos_nca_saas_sdk/integration_testing/example_main.py,sha256=9SXu8s7B4MLe53WDkr0GuMu8h4oyfmltYOH1XT_fqC4,2500
5
5
  aplos_nca_saas_sdk/integration_testing/integration_test_base.py,sha256=ci3oOfz_McdDKGSrqOHF7F_vrvgTWo7HzxydNdPSHLs,2787
6
6
  aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py,sha256=GRDHSy0ZiAJtZQvL7uPlYG2oYVo9nWlP7hNZbNnrz7U,1900
@@ -42,11 +42,11 @@ aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/config.json,sha256=lLnR
42
42
  aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/input.csv,sha256=qFSAlgLOmERsabMmp1X6PAZa-8yFthZlHacM_f7_AOY,6528
43
43
  aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/meta_data.json,sha256=p1KYOAe5Cl3rjtfF1t96oRG-QtFJJCo9otReRPNtvIk,447
44
44
  aplos_nca_saas_sdk/utilities/commandline_args.py,sha256=iia2g0sdPfg637GV8PuddRNUAtg46GdmlDx4OJ0iS-s,10242
45
- aplos_nca_saas_sdk/utilities/environment_services.py,sha256=Hq7GzkWIPOYdoUTtI3LSpjdfVoebS4y5W4XmGCXo41I,2750
45
+ aplos_nca_saas_sdk/utilities/environment_services.py,sha256=dCdUSL1GAzvCVLpkgRLnG3Z-h5wAi27SldeQHvH007o,3746
46
46
  aplos_nca_saas_sdk/utilities/environment_vars.py,sha256=aXheFXg6FVMaSYLe2LmoWRF5Ks9vwxDazO4XYb4vLjc,1132
47
- aplos_nca_saas_sdk/utilities/file_utility.py,sha256=vYtXM5juEOe5A1w9dQd4G96kwVgkSOqwPCbHMM9vrdU,2163
47
+ aplos_nca_saas_sdk/utilities/file_utility.py,sha256=J4cN0zizcA-oZnALu1ICiImi_KcIzN1yQ0Bj0lfpeX4,1364
48
48
  aplos_nca_saas_sdk/utilities/http_utility.py,sha256=DQ-ClLOmNoyPn5vhrSh4q-2wi4ViP_gplJD9asEKDM8,464
49
- aplos_nca_saas_sdk-0.0.23.dist-info/METADATA,sha256=9UCpmWWDtr0VJnERN_RWby5neCrCyMZBIKZg7FunzA8,3792
50
- aplos_nca_saas_sdk-0.0.23.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
- aplos_nca_saas_sdk-0.0.23.dist-info/licenses/LICENSE,sha256=JQMpBrnqu_m2tISmyh6_dTgb8-m3HNnA51fuOh2TzkE,1076
52
- aplos_nca_saas_sdk-0.0.23.dist-info/RECORD,,
49
+ aplos_nca_saas_sdk-0.0.24.dist-info/METADATA,sha256=rrw6LHlnlYnRLrgB81u1nJX-QYsdcZT_BzJVv9rnBo0,3792
50
+ aplos_nca_saas_sdk-0.0.24.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
+ aplos_nca_saas_sdk-0.0.24.dist-info/licenses/LICENSE,sha256=JQMpBrnqu_m2tISmyh6_dTgb8-m3HNnA51fuOh2TzkE,1076
52
+ aplos_nca_saas_sdk-0.0.24.dist-info/RECORD,,