python-eigen-ingenuity 0.4.35b3__py3-none-any.whl → 0.4.36__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.
@@ -15,19 +15,34 @@ class CSVContentsManager:
15
15
  self.formats = []
16
16
  self.types = []
17
17
 
18
- for header in file_headers:
19
- this_format = ''
20
- this_type = ''
21
- split_header = header.split(':')
22
- this_key = split_header[0].replace('\ufeff', '')
23
- for format_type in split_header[1:]:
24
- if format_type and format_type in amu.all_types:
25
- this_type += ':' + format_type
18
+ def split_header(header):
19
+ # Format of header is key[:format][:type]
20
+ # If there is only one of [:format] and [:type], look to see if the value is in amu.all_types
21
+ # If it is, treat it as a type, otherwise as a format
22
+
23
+ format = ''
24
+ type = ''
25
+ header_parts = header.split(':')
26
+ key = header_parts[0].replace('\ufeff', '')
27
+ if len(header_parts) == 3:
28
+ format = ':' + header_parts[1]
29
+ type = ':' + header_parts[2]
30
+ elif len(header_parts) == 2:
31
+ part = header_parts[1]
32
+ if part and part in amu.all_types:
33
+ type = ':' + part
26
34
  else:
27
- this_format += ':' + format_type
28
- if this_format == '' and default_data_type != '':
29
- this_format = ':' + default_data_type
35
+ format = ':' + part
36
+
37
+ print(f'H: {header} -> ({key}, {format}, {type})')
30
38
 
39
+ return key, format, type
40
+
41
+ print(f'HM: {header_mappings}')
42
+ for header in file_headers:
43
+
44
+ print(f'H: {header}')
45
+ this_key, this_format, this_type = split_header(header)
31
46
  unmapped_keys += [this_key]
32
47
 
33
48
  # Now apply key mappings from config file
@@ -35,6 +50,10 @@ class CSVContentsManager:
35
50
  mapped_key = header_mappings[this_key]
36
51
  elif this_key + this_format in header_mappings:
37
52
  mapped_key = header_mappings[this_key + this_format]
53
+ elif this_key + this_type in header_mappings:
54
+ mapped_key = header_mappings[this_key + this_type]
55
+ elif this_key + this_format + this_type in header_mappings:
56
+ mapped_key = header_mappings[this_key + this_format + this_type]
38
57
  else:
39
58
  mapped_key = this_key
40
59
 
@@ -46,23 +65,18 @@ class CSVContentsManager:
46
65
  if this_key != alias_mapped_key:
47
66
  this_mapped_key = alias_mapped_key
48
67
  elif this_key != mapped_key:
49
- split_mapped_key = mapped_key.split(':')
50
- this_mapped_key = split_mapped_key[0]
51
- # Mapped Key may have new format...
52
- if len(split_mapped_key) > 1:
53
- if split_mapped_key[1] != '':
54
- this_format = ':' + split_mapped_key[1]
55
- else:
56
- this_format = ''
68
+ this_mapped_key, this_format, this_type = split_header(mapped_key)
57
69
  else:
58
70
  this_mapped_key = this_key
71
+
59
72
  mapped_keys += [this_mapped_key]
60
73
 
61
- self.unmapped_keys = pm.validate_properties(unmapped_keys)
62
- self.mapped_keys = pm.validate_properties(mapped_keys)
63
74
  self.formats += [this_format]
64
75
  self.types += [this_type]
65
76
 
77
+ self.unmapped_keys = pm.validate_properties(unmapped_keys)
78
+ self.mapped_keys = pm.validate_properties(mapped_keys)
79
+
66
80
  def get_row_count(self):
67
81
  return len(self.data_list)
68
82
 
@@ -164,7 +164,7 @@ class RelationshipFileProcessor:
164
164
  last_row = self.get_last_row(num_data_rows)
165
165
  while this_row < last_row:
166
166
  relationships = rm.validate_relationships(self.contents.get_column_values_list(this_row, relation_columns))
167
- properties = self.contents.get_property_values_dict(this_row, property_columns, self.allow_blanks, prefix=relation_ref_dot)
167
+ properties = self.contents.get_property_values_dict(this_row, property_columns, self.allow_blanks)
168
168
  # If there are multiple From or To nodes, create a relationship query for each combination
169
169
  for from_node in self.contents.get_property_values_list(this_row, from_columns, False, self.primary_property, self.primary_property):
170
170
  validated_csv_from_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, from_label_columns))
@@ -40,6 +40,9 @@ class Properties(dict):
40
40
  case 'str':
41
41
  result = quote + escaped_value + quote
42
42
  case 'int':
43
+ # Remove any leading zeroes because the literal_eval function does not support them
44
+ while escaped_value.startswith('0'):
45
+ escaped_value = escaped_value[1:]
43
46
  result = int(ast.literal_eval(escaped_value))
44
47
  if result != ast.literal_eval(escaped_value):
45
48
  messages.warning_message('Invalid data: ', f'{ast.literal_eval(escaped_value)} is not a valid Integer, {result} used instead')
@@ -61,7 +64,7 @@ class Properties(dict):
61
64
  # Treat unsupported formats as strings
62
65
  result = quote + escaped_value + quote
63
66
  except:
64
- messages.error_message('Invalid data: ', f'{value} is not valid for type {given_data_type} so value not set')
67
+ messages.error_message('Invalid data: ', f'{value} is not valid for type {given_data_type} so value not set!')
65
68
  result = ''
66
69
  else:
67
70
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-eigen-ingenuity
3
- Version: 0.4.35b3
3
+ Version: 0.4.36
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
@@ -16,7 +16,7 @@ modelbuilder/src/assetmodelbuilder.py,sha256=Gii5mU5z8spk1d53_veD4rlgaXL3xtev6OF
16
16
  modelbuilder/src/assetmodelcsvwriter.py,sha256=GKNi_fw7AlY-UG2XhwFIS34Ff3XiVRss-o5MUzyJSV0,1071
17
17
  modelbuilder/src/assetmodelutilities.py,sha256=KwyP8-2EfpRHKmGasPJLV74EGYBjSHgxHBAy8xuvh6k,1743
18
18
  modelbuilder/src/configmanager.py,sha256=LwIGf87so4VeYhIEJ3WVEEj834QCq0svDs2gcyGowuI,22948
19
- modelbuilder/src/csvcontentsmanager.py,sha256=2j5QwzbyL618QJGMIQ7h3l9hvRH4-23LSTz9fTKTrXk,6029
19
+ modelbuilder/src/csvcontentsmanager.py,sha256=6IIzmCz6zEhpm0gZm-3Nr9_ASKrNo70xJoqn7EJPMD0,6491
20
20
  modelbuilder/src/csvwriter.py,sha256=m2XVbyZq3Gq2bb36HqvOFuTuet1fi1nRPURL6yEtfjI,14051
21
21
  modelbuilder/src/fileanalyser.py,sha256=LUWrqogjBXsXHV-maoEOmu6FKuu7JmvNZJZMlFhbKQA,3627
22
22
  modelbuilder/src/filemanager.py,sha256=h8BHOEWA94jvDw8WCiGbXwhRDm2FvycJgoTyO1gTi88,18834
@@ -33,14 +33,14 @@ modelbuilder/src/processors/cypherfileprocessor.py,sha256=Y77GddRVhQKNhs6V4jfqwE
33
33
  modelbuilder/src/processors/labelmanager.py,sha256=03fD-JXjdeEyHXUeihst5rVWgmd-3-Y8fSMM42OfsT8,6237
34
34
  modelbuilder/src/processors/nodefileprocessor.py,sha256=Ww9KhNk9YAKSb91LxapLX_NgGdvSwIbnX7bfPPMok-s,12773
35
35
  modelbuilder/src/processors/propertymanager.py,sha256=O47J-2ZBuDWLointG6LhEDh-T_5PXHHSp2cECQ2fpno,3795
36
- modelbuilder/src/processors/relationshipfileprocessor.py,sha256=YmArvCaW0XLOKmOYrToEeNpw7djpp8GDnAVHoUWK1fA,14962
36
+ modelbuilder/src/processors/relationshipfileprocessor.py,sha256=hSL-094K0lxOW8TkBW54dkUg1GogO2iaEj_d5jM8KDM,14937
37
37
  modelbuilder/src/processors/relationshipmanager.py,sha256=lDtE_5AdKzL3boq7VD8Gmpai8Uscq79vRxkzYQL8A9A,1105
38
38
  modelbuilder/src/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  modelbuilder/src/queries/cypherbuilder.py,sha256=XHChyxnTyJegfVhN949UU0T3t3Lf1CKgN0yCN8Cx8cM,10384
40
40
  modelbuilder/src/queries/query.py,sha256=gN69uwsf-0F6_dGx9cxLGuM17960_FV58pyimJ9usxY,2472
41
- modelbuilder/src/queries/typedefs.py,sha256=9FMoTp1f6KyFt8KUN5YzE83xRZNVsnTTXqN7hV4kV5U,5897
42
- python_eigen_ingenuity-0.4.35b3.dist-info/METADATA,sha256=aTpW0-GeBN8HM7y0pAyETXKyfWn49DiGSOhF0Qm3uhA,32121
43
- python_eigen_ingenuity-0.4.35b3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
44
- python_eigen_ingenuity-0.4.35b3.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
45
- python_eigen_ingenuity-0.4.35b3.dist-info/top_level.txt,sha256=lFiZ43CY_1bmdtRidIXbA6rrY2d92Rs-9tH8pcgI-XU,28
46
- python_eigen_ingenuity-0.4.35b3.dist-info/RECORD,,
41
+ modelbuilder/src/queries/typedefs.py,sha256=8uAnLfE_EyAfrdMZuotfu_YHqORXhWfgPG3Yltvyr5A,6129
42
+ python_eigen_ingenuity-0.4.36.dist-info/METADATA,sha256=KO3bssf3MwVYQchzQI98wOm6nI9XRSzfYCYM2s8-Wys,32119
43
+ python_eigen_ingenuity-0.4.36.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
44
+ python_eigen_ingenuity-0.4.36.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
45
+ python_eigen_ingenuity-0.4.36.dist-info/top_level.txt,sha256=lFiZ43CY_1bmdtRidIXbA6rrY2d92Rs-9tH8pcgI-XU,28
46
+ python_eigen_ingenuity-0.4.36.dist-info/RECORD,,