Skip to content

Commit cc3dfb7

Browse files
authored
Merge pull request #20 from Loop3D/add_multiple_thicknesses
Add multiple thicknesses
2 parents c8684d4 + 53df818 commit cc3dfb7

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

LoopProjectFile/LoopProjectFile.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ class EventRelationshipType(enum.IntEnum):
6363
FAULT_FAULT_ABUT = 3
6464
FAULT_FAULT_OVERPRINT = 4
6565

66+
class ThickenessCalculatorType(enum.IntEnum):
67+
ALPHA = 0
68+
INTERPOLATED_STRUCTURE = 1
69+
STRUCTURAL_POINT = 2
70+
PLACEHOLDER_1 = 3
71+
PLACEHOLDER_2 = 4
6672

6773
# ### External Accessors ### #
6874

@@ -733,9 +739,9 @@ def CheckFileValid(filename, verbose=False):
733739
("group", "S120"),
734740
("supergroup", "S120"),
735741
("enabled", "u1"),
736-
("ThicknessMean", "<f8"),
737-
("ThicknessMedian", "<f8"),
738-
("ThicknessStdDev", "<f8"),
742+
("ThicknessMean", "<f8", (len(ThickenessCalculatorType)), ),
743+
("ThicknessMedian", "<f8", (len(ThickenessCalculatorType)), ),
744+
("ThicknessStdDev", "<f8", (len(ThickenessCalculatorType)), ),
739745
("colour1Red", "u1"),
740746
("colour1Green", "u1"),
741747
("colour1Blue", "u1"),

LoopProjectFile/LoopProjectFileUtils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pandas
33
import os
44
import sys
5+
import numpy
56
import LoopProjectFile
67

78

@@ -305,7 +306,8 @@ def ElementToDataframe(loopFilename, element, loopCompoundType):
305306
columns = list(loopCompoundType.names)
306307
df = pandas.DataFrame.from_records(resp["value"], columns=columns)
307308
for name in columns:
308-
df[name] = df[name].astype(loopCompoundType[name])
309+
if type(loopCompoundType[name]) != numpy.dtypes.VoidDType:
310+
df[name] = df[name].astype(loopCompoundType[name])
309311
df = df.map(lambda x: x.decode() if isinstance(x, bytes) else x)
310312
# df.set_index(columns[0], inplace=True)
311313
return df # .to_csv(outputFilename)

LoopProjectFile/Version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.1.4"
22

33

44
# Current Loop Project File Version

0 commit comments

Comments
 (0)