python-eigen-ingenuity 0.5.21__py3-none-any.whl → 0.5.21b1__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.
@@ -253,7 +253,6 @@ class ConfigManager:
253
253
  self.no_version = True
254
254
 
255
255
  def read_csv_config(self):
256
- self.separators = {s: self.get_config_value(s, "Separator", self.separator, allow_comma=True) for s in self.available_sections}
257
256
  self.primary_property = {s: self.primary_property_override or self.get_config_value(s, "PrimaryProperty", "node") for s in self.available_sections}
258
257
  self.default_data_type = {s: self.get_config_value(s, "DataType", "") for s in self.available_sections}
259
258
  self.required_labels_list = {s: lm.combine_required_labels(self.get_config_value_list(s, "RequiredLabels", ""), self.required_labels_override) for s in self.available_sections}
@@ -307,7 +306,7 @@ class ConfigManager:
307
306
  def get_error_list(self):
308
307
  return self.error_list
309
308
 
310
- def get_config_value_list(self, section, option, default=None, allow_comma=False):
309
+ def get_config_value_list(self, section, option, default=None):
311
310
  # Get a node_value from the settings file, reporting an error if it's missing
312
311
  try:
313
312
  raw_value = self.config[section][option] or default
@@ -320,15 +319,7 @@ class ConfigManager:
320
319
  # Reformat from a single string of comma separated values to a List (of strings)
321
320
  # removing leading and trailing spaces while we're at it
322
321
  if raw_value:
323
- # Need to handle the case when the required input is a comma and comma is allowed
324
- # (which it might be for Separator=, but not for, say, users=)
325
- # Since a comma is usually treated as the value separator, using .split won't give what we need -
326
- # it will return ['', ''] when we need [',']
327
- # So, we'll have to test explicitly for a comma and handle it as a special case
328
- if allow_comma and raw_value == ',':
329
- return [',']
330
- else:
331
- return [i.strip() for i in raw_value.split(',')]
322
+ return [i.strip() for i in raw_value.split(',')]
332
323
  else:
333
324
  return []
334
325
 
@@ -351,13 +342,13 @@ class ConfigManager:
351
342
  else:
352
343
  return {}
353
344
 
354
- def get_config_value(self, section, option, default=None, allow_comma=False):
345
+ def get_config_value(self, section, option, default=None):
355
346
  # Get a node_value from the settings file, reporting an error if it's missing
356
- value_list = self.get_config_value_list(section, option, default, allow_comma)
347
+ value_list = self.get_config_value_list(section, option, default)
357
348
  if value_list:
358
349
  value = value_list[0]
359
350
  if len(value_list) > 1:
360
- warning_message(f'Multiple values for [{section}]{option} found, using ', value)
351
+ warning('Warning! ', f'Multiple values for [{section}]{option} found - using {value}')
361
352
  else:
362
353
  value = default
363
354
 
@@ -388,7 +379,7 @@ class ConfigManager:
388
379
  return self.labels_to_delete
389
380
 
390
381
  def get_separator(self):
391
- return self.separators
382
+ return self.separator
392
383
 
393
384
  def get_start_from(self):
394
385
  return self.start_from
@@ -7,7 +7,7 @@ import assetmodelutilities as amu
7
7
  class FileAnalyser():
8
8
 
9
9
  def __init__(self, config, section):
10
- self.separator = config.get_separator()[section]
10
+ self.separator = config.get_separator()
11
11
  self.def_path = config.get_default_path()
12
12
 
13
13
  header_mappings, alias_mappings = config.get_header_mappings()
@@ -202,7 +202,7 @@ class RelationshipFileProcessor:
202
202
 
203
203
  explicit_properties, calculated_properties = pm.split_out_functional_properties(properties)
204
204
  new_labels = [from_labels, to_labels, relation, from_node.key, to_node.key, calculated_properties]
205
- query_data = [from_node.value.replace('\\\\n', '\n'), to_node.value.replace('\\\\n', '\n'), explicit_properties, calculated_properties, time_now]
205
+ query_data = [from_node.value, to_node.value, explicit_properties, calculated_properties, time_now]
206
206
 
207
207
  # So now we know all about this particular update. Let's put it in the query dictionary
208
208
  try:
@@ -62,9 +62,13 @@ def format_value(self, ref):
62
62
  given_data_format = self.format
63
63
 
64
64
  # Redo the formula if ref is not 'n.' (which we did in the init section) and it is a real formula
65
- if self.is_formula and ref != 'n.':
66
- self.formula, self.is_formula = parse_value(self.value, ref)
67
- formula = self.formula
65
+ if self.is_formula:
66
+ if ref != 'n.':
67
+ formula, is_formula = parse_value(self.value, ref)
68
+ else:
69
+ formula = self.formula
70
+ else:
71
+ formula = ''
68
72
 
69
73
  if self.is_formula and formula != '':
70
74
  match given_data_format:
@@ -90,15 +94,12 @@ def format_value(self, ref):
90
94
  case 'str':
91
95
  result = quote + (formula or value) + quote
92
96
  case 'int':
93
- if value != '0':
94
- # Remove any leading zeroes because the literal_eval function does not support them
95
- while value.startswith('0'):
96
- value = value[1:]
97
- result = int(ast.literal_eval(value))
98
- if result != ast.literal_eval(value):
99
- messages.warning_message('Invalid data: ', f'{value} is not a valid Integer, {result} used instead')
100
- else:
101
- result = 0
97
+ # Remove any leading zeroes because the literal_eval function does not support them
98
+ while value.startswith('0'):
99
+ value = value[1:]
100
+ result = int(ast.literal_eval(value))
101
+ if result != ast.literal_eval(value):
102
+ messages.warning_message('Invalid data: ', f'{value} is not a valid Integer, {result} used instead')
102
103
  case 'float':
103
104
  result = float(ast.literal_eval(value))
104
105
  case 'bool' | 'boolean':
@@ -187,7 +188,7 @@ def format_value(self, ref):
187
188
  result = quote + value + quote
188
189
  self.format = 'str'
189
190
  except:
190
- messages.error_message('Invalid data: ', f"{value} is not valid for property {self.key} with type '{given_data_format}' so value not set!")
191
+ messages.error_message('Invalid data: ', f"{value} is not valid for type '{given_data_format}' so value not set!")
191
192
  result = '""'
192
193
 
193
194
  return result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-eigen-ingenuity
3
- Version: 0.5.21
3
+ Version: 0.5.21b1
4
4
  Summary: A python library used to query data from the Eigen Ingenuity system
5
5
  Home-page: https://www.eigen.co/
6
6
  Author: Murray Callander
@@ -39,13 +39,13 @@ modelbuilder/src/__init__.py,sha256=bMvb-E_plw2dz9_TYIPevQuvDNmKtW0dmBgnQE9ylwc,
39
39
  modelbuilder/src/assetmodelbuilder.py,sha256=JgeO0tTCIvT5p2d2U7q4KNO4Yw9LGu4H37aeCTfP3Xw,8737
40
40
  modelbuilder/src/assetmodelcsvwriter.py,sha256=GKNi_fw7AlY-UG2XhwFIS34Ff3XiVRss-o5MUzyJSV0,1071
41
41
  modelbuilder/src/assetmodelutilities.py,sha256=KwyP8-2EfpRHKmGasPJLV74EGYBjSHgxHBAy8xuvh6k,1743
42
- modelbuilder/src/configmanager.py,sha256=I3O0aLf63Uk28eiq9SdxeF1kqdqDigPBgsUN4Ryef0A,28108
42
+ modelbuilder/src/configmanager.py,sha256=mnUlUhAgcMdYXcjKU-CKiiItuOFb8kvDGvl-Fe92CpY,27398
43
43
  modelbuilder/src/csvcontentsmanager.py,sha256=uj_P9uakT5FA-W3xFFr-XoBSpAPC7KHtkPpV6npYMZs,7848
44
44
  modelbuilder/src/csvwriter.py,sha256=2Xc6kdV6cYwCjrVF6WaZfS6tVp8-oc0ksIHSOx6iqj8,14132
45
- modelbuilder/src/fileanalyser.py,sha256=o5Vx9DvBqEMcaGq3lf4HlcfCn_pPJnHnSGQaLqKNLC8,4302
45
+ modelbuilder/src/fileanalyser.py,sha256=5bLKB5yTseNK8B28L44ejwBZnesuIwacj77MLnw85-M,4293
46
46
  modelbuilder/src/filemanager.py,sha256=9SUctUBaDnXlV_2YxPm1ZtQX-HwEpZU7UBHyhJuLaPM,23045
47
47
  modelbuilder/src/messages.py,sha256=6JnW-ke6nHGUA4hTEBvo_kVlNJTXoV4LWw8mNwMpBCQ,1325
48
- modelbuilder/src/property.py,sha256=flK2WQxV3zWA8KN90ZJQg_tkbP_ltYGTho8jG6WXvLs,12815
48
+ modelbuilder/src/property.py,sha256=PN_w8UTObEjHS5GfiHtZRbV1ZM62EB-H44l8-1fKJNI,12727
49
49
  modelbuilder/src/versionmanager.py,sha256=B8mrYY5Der0sWi1GQjduyVGZ6BuAb6rTNVAZzQlP4k4,19148
50
50
  modelbuilder/src/connectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  modelbuilder/src/connectors/boltconnector.py,sha256=9mFpYUqYzf--o_8gLw00BjPOmOqo1X1KsdxjFkzYRaQ,4885
@@ -57,7 +57,7 @@ modelbuilder/src/processors/cypherfileprocessor.py,sha256=Y77GddRVhQKNhs6V4jfqwE
57
57
  modelbuilder/src/processors/labelmanager.py,sha256=F3mWxdlJZS9B6ksuXdlkQOU9Axqa_FRenHRxslteA3k,6672
58
58
  modelbuilder/src/processors/nodefileprocessor.py,sha256=qZsvIzNkjrn2Iujnklqv70-hGhKpa1y2KXA6boqii_s,13666
59
59
  modelbuilder/src/processors/propertymanager.py,sha256=8P1XLx6Ad8omPoDPLu6fv_TXqW-A4_umgeSYLsO0tpM,6996
60
- modelbuilder/src/processors/relationshipfileprocessor.py,sha256=I45Ae9fgmcgW8KaFz3rldOjnkFSfew4BB4zeFi6XJbA,17065
60
+ modelbuilder/src/processors/relationshipfileprocessor.py,sha256=niMxLir_YsH8Shq24CA8oJ8QKgvgm1xIX6Fvlk_lDdo,17019
61
61
  modelbuilder/src/processors/relationshipmanager.py,sha256=lDtE_5AdKzL3boq7VD8Gmpai8Uscq79vRxkzYQL8A9A,1105
62
62
  modelbuilder/src/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  modelbuilder/src/queries/cypherbuilder.py,sha256=VpUGuPo-Ba3skjCVBFjmxm4ORQBGgF5cDiQYnK67hLA,10418
@@ -86,8 +86,8 @@ regressiontests/eigeningenuity/historian-multi/test_getRawDatapoints.py,sha256=f
86
86
  regressiontests/eigeningenuity/historian-multi/test_listDataTags.py,sha256=TcceNSjCKoiK5SJcgTH2JXfKLYxIHdQdwZWlkpGnEVM,2006
87
87
  regressiontests/eigeningenuity/historian-multi/test_tagManagement.py,sha256=ylInBt453d1RaSih1eTTxGPZmb60UK4vMwI3UW-U1JY,4830
88
88
  regressiontests/eigeningenuity/historian-multi/test_writePoints.py,sha256=51tfUSLUqLKcCKJ1EyhjfzoC_4OP6n1oL3zgTSkXu4s,2696
89
- python_eigen_ingenuity-0.5.21.dist-info/METADATA,sha256=gEYz5oox5nb_fLxOgtr0UunwlG2wVG4MdEtxRxJ2WZA,38419
90
- python_eigen_ingenuity-0.5.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
- python_eigen_ingenuity-0.5.21.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
92
- python_eigen_ingenuity-0.5.21.dist-info/top_level.txt,sha256=oDWOSmlNPKNBlIEKP8_JaV01O60jTcUIt2tDkq3OD18,56
93
- python_eigen_ingenuity-0.5.21.dist-info/RECORD,,
89
+ python_eigen_ingenuity-0.5.21b1.dist-info/METADATA,sha256=4_e_Zu3aJg7F0iMvQQoBUQRbQIj7PbSujB2z5nC6Ys0,38421
90
+ python_eigen_ingenuity-0.5.21b1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
+ python_eigen_ingenuity-0.5.21b1.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
92
+ python_eigen_ingenuity-0.5.21b1.dist-info/top_level.txt,sha256=oDWOSmlNPKNBlIEKP8_JaV01O60jTcUIt2tDkq3OD18,56
93
+ python_eigen_ingenuity-0.5.21b1.dist-info/RECORD,,