Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions LoopProjectFile/LoopProjectFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ class EventRelationshipType(enum.IntEnum):
FAULT_FAULT_ABUT = 3
FAULT_FAULT_OVERPRINT = 4

class ThickenessCalculatorType(enum.IntEnum):
ALPHA = 0
INTERPOLATED_STRUCTURE = 1
STRUCTURAL_POINT = 2
PLACEHOLDER_1 = 3
PLACEHOLDER_2 = 4

# ### External Accessors ### #

Expand Down Expand Up @@ -733,9 +739,9 @@ def CheckFileValid(filename, verbose=False):
("group", "S120"),
("supergroup", "S120"),
("enabled", "u1"),
("ThicknessMean", "<f8"),
("ThicknessMedian", "<f8"),
("ThicknessStdDev", "<f8"),
("ThicknessMean", "<f8", (len(ThickenessCalculatorType)), ),
("ThicknessMedian", "<f8", (len(ThickenessCalculatorType)), ),
("ThicknessStdDev", "<f8", (len(ThickenessCalculatorType)), ),
("colour1Red", "u1"),
("colour1Green", "u1"),
("colour1Blue", "u1"),
Expand Down
4 changes: 3 additions & 1 deletion LoopProjectFile/LoopProjectFileUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pandas
import os
import sys
import numpy
import LoopProjectFile


Expand Down Expand Up @@ -305,7 +306,8 @@ def ElementToDataframe(loopFilename, element, loopCompoundType):
columns = list(loopCompoundType.names)
df = pandas.DataFrame.from_records(resp["value"], columns=columns)
for name in columns:
df[name] = df[name].astype(loopCompoundType[name])
if type(loopCompoundType[name]) != numpy.dtypes.VoidDType:
df[name] = df[name].astype(loopCompoundType[name])
df = df.map(lambda x: x.decode() if isinstance(x, bytes) else x)
# df.set_index(columns[0], inplace=True)
return df # .to_csv(outputFilename)
Expand Down
2 changes: 1 addition & 1 deletion LoopProjectFile/Version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.0"
__version__ = "0.1.4"


# Current Loop Project File Version
Expand Down