TensileTestConfig
class TensileTestConfig(**kwargs)
Centralized configuration for tensile test analysis with sensible defaults. All settings are optional.
Quick Start
from tensile import TensileTestConfig
# Use defaults
config = TensileTestConfig()
# Custom configuration
config = TensileTestConfig(
specimen_length=75.0, # Custom gauge length
E_measurement_strain_range=(0.0005, 0.0025), # Tighter E range
min_rm_mpa=400.0, # Minimum UTS
noise_threshold_mpa=5.0 # Stricter noise threshold
)
# Use with TensileTest
test = TensileTest.from_csv("data.csv", config=config)
Commonly Adjusted Parameters
specimen_length
Gauge length for strain calculation
min_rm_mpa
Minimum acceptable UTS
noise_threshold_mpa
Stress noise detection threshold
E_measurement_strain_range
Strain range for Young's modulus
export_format
Default export format (xlsx/csv/html)
detect_slippage
Enable slippage detection
Constructor
__init__(**kwargs)
Initialize configuration with optional keyword arguments. All parameters have defaults.
File & Data Settings
| Parameter | Default | Description |
|---|---|---|
skip_rows |
2 | Number of header rows to skip in CSV |
delimiter |
';' | CSV delimiter character |
decimal |
',' | Decimal separator for numeric data |
encoding |
'windows-1250' | File encoding |
force_col |
0 | Column index for force data |
extension_col |
1 | Column index for extension data |
specimen_length |
50.0 | Gauge length in mm |
specimen_diameter |
5.0 | Diameter in mm (for area calculation) |
Quality Validation Settings
| Parameter | Default | Description |
|---|---|---|
min_rm_mpa |
300.0 | Minimum acceptable ultimate tensile strength |
max_rm_mpa |
3000.0 | Maximum acceptable UTS |
min_rp02_mpa |
100.0 | Minimum acceptable yield strength |
max_rp02_mpa |
2500.0 | Maximum acceptable yield strength |
min_e_gpa |
50.0 | Minimum Young's modulus |
max_e_gpa |
500.0 | Maximum Young's modulus |
min_at_percent |
1.0 | Minimum elongation at break |
max_at_percent |
100.0 | Maximum elongation at break |
noise_threshold_mpa |
10.0 | Max stress fluctuation before detection |
negative_stress_allowed |
False | Allow negative stress values |
Analysis Settings
| Parameter | Default | Description |
|---|---|---|
E_measurement_strain_range |
(0.0005, 0.003) | Strain range for modulus fitting |
yield_offset |
0.002 | Offset strain for Rp0.2 (0.2%) |
smoothing_window |
51 | Savitzky-Golay filter window size |
smoothing_polyorder |
3 | Polynomial order for smoothing |
detect_slippage |
True | Enable automatic slippage detection |
slippage_stress_threshold |
50.0 | Stress threshold for slippage (MPa) |
slippage_strain_limit |
0.005 | Max strain before slippage ends (0.5%) |
Export Settings
| Parameter | Default | Description |
|---|---|---|
export_format |
'xlsx' | Default format: 'xlsx', 'csv', or 'html' |
include_plots |
True | Include visualizations in exports |
export_raw_data |
False | Include raw force-extension data |
export_cleaned_data |
True | Include processed stress-strain data |
Usage Examples
# Aluminum alloy configuration
al_config = TensileTestConfig(
min_rm_mpa=200.0,
max_rm_mpa=600.0,
min_e_gpa=60.0,
max_e_gpa=80.0
)
# High-strength steel configuration
steel_config = TensileTestConfig(
min_rm_mpa=800.0,
max_rm_mpa=2000.0,
min_rp02_mpa=500.0,
noise_threshold_mpa=15.0
)
# Custom data format
custom_config = TensileTestConfig(
delimiter=',',
decimal='.',
encoding='utf-8',
skip_rows=5,
force_col=2,
extension_col=3
)