|
5 | 5 | import pandas as pd |
6 | 6 | import numpy as np |
7 | 7 |
|
| 8 | + |
8 | 9 | class QgsProcessInputData(ProcessInputData): |
9 | 10 | def __init__( |
10 | 11 | self, |
@@ -42,17 +43,22 @@ def __init__( |
42 | 43 |
|
43 | 44 | origin = (minx, miny, bottom) |
44 | 45 | maximum = (maxx, maxy, top) |
45 | | - if contact_locations is not None and 'unitname' in columnmap.keys(): |
| 46 | + if contact_locations is not None and columnmap['unitname'] in contact_locations: |
46 | 47 | contact_locations = contact_locations.rename(columns={columnmap['unitname']: 'name'})[ |
47 | 48 | ['X', 'Y', 'Z', 'name'] |
48 | 49 | ] |
49 | | - if fault_data is not None and 'faultname' in columnmap.keys(): |
| 50 | + if fault_data is not None and columnmap['faultname'] in fault_data: |
50 | 51 | fault_data = fault_data.rename(columns={columnmap['faultname']: 'fault_name'})[ |
51 | 52 | ['X', 'Y', 'Z', 'fault_name'] |
52 | 53 | ] |
53 | 54 | if np.all(fault_data['fault_name'].isna()): |
54 | 55 | raise ValueError('Fault column name is all None. Check the column name') |
55 | | - if contact_orientations is not None and 'dip' in columnmap.keys() and 'orientation' in columnmap.keys() and 'structure_unitname' in columnmap.keys(): |
| 56 | + if ( |
| 57 | + contact_orientations is not None |
| 58 | + and columnmap['structure_unitname'] in contact_orientations |
| 59 | + and columnmap['dip'] in contact_orientations |
| 60 | + and columnmap['orientation'] in contact_orientations |
| 61 | + ): |
56 | 62 | contact_orientations = contact_orientations.rename( |
57 | 63 | columns={ |
58 | 64 | columnmap['structure_unitname']: 'name', |
|
0 commit comments