snpl.tensile module¶
I/O interfaces for tensile test data
- snpl.tensile.load_TrapeziumCSV(fp, encoding='shift-jis', dialect='excel')[source]¶
Loads a CSV file exported by Trapezium software.
Works both for Trapezium 3 (for AGS-X) and Trapezium 2 (for EZ-L).
- Parameters:
fp (str or file-like) – Path or file-like object of the source CSV file.
encoding (str) – Encoding of the source file. Defaults to shift-jis.
dialect (str) – Dialect of the CSV to be read. Defaults to
excel
(comma-delimited). Setting toexcel-tab
enables loading a tab-delimited values (TSV).
- Returns:
A list of
hicsv.hicsv
objects for each test pieces (batches).
Note
This function is compatible with the data collected with “Single” and “Control” programs in the Trapezium software, but not with “Cycle” program. For the data collected with “Cycle” program, use
load_TrapeziumCycleCSV
.Examples
>>> ds = tensile.load_TrapeziumCSV("trapezium_csv.csv") >>> >>> for d in ds: >>> d.save("piece " + c.h["名前"] + ".txt") # save each batch using the batch name as the file name
- snpl.tensile.load_TrapeziumCycleCSV(fp, encoding='shift-jis', initial_cycle_id=0, dialect='excel')[source]¶
Loads a cycle CSV file exported by Trapezium software.
To discriminate between the cycles, each cycle will be given a unique and consequtive “Cycle ID”, usually starting from zero.
- Parameters:
fp (str or file-like) – Path or file-like object of the source CSV file.
encoding (str) – Encoding of the source file. Defaults to shift-jis.
initial_cycle_id (int) – Index of the first cycle. This integer number will be used as the “Cycle ID” of the first cycle.
dialect (str) – Dialect of the CSV to be read. Defaults to
excel
(comma-delimited). Setting toexcel-tab
enables loading a tab-delimited values (TSV).
- Returns:
A list of
hicsv.hicsv
objects for each cycle.
Note
This function is not compatible with the data collected with “Single” and “Control” programs in the Trapezium software. For these cases, use
load_TrapeziumCSV
.Examples
>>> ds = tensile.load_TrapeziumCSV("trapezium_cycle.csv") >>> >>> for d in ds: >>> d.save("piece " + c.h["Cycle ID"] + ".txt") # save each cycle using the cycle id as the file name