Load tests with unified function.#

This example shows how to load multiple test data files using the unified load_tests() function from the library that handles both file discovery and parsing.

First, we import the required libraries.#

import warnings

from sda.api import list_all_tests, load_tests

# Suppress warnings for cleaner output.
# See https://stackoverflow.com/questions/53965596/python-3-openpyxl-userwarning-data-validation-extension-not-supported
warnings.simplefilter(action="ignore", category=UserWarning)

Example 1: Discover available tests dynamically.#

print("=== Discovering Available Tests ===")
all_tests = list_all_tests()
print(f"Found {len(all_tests)} tests total on this machine")

print("\nAll tests:")
for test in all_tests:
    print(f"- {test}")

Load all available test data.#

print("\nLoading All Test Data")
df_all = load_tests()

print(f"Data shape: {df_all.shape}")
print(f"✓ Total: {len(df_all)} experimental points")
print(df_all.head())

Load specific tests only.#

print("\nLoading Specific Tests Only")
# Use some of the discovered tests
specific_tests = list_all_tests(filter="T2*")
print(f"Loading specific tests: {specific_tests}")
df_specific = load_tests(test_names=specific_tests)

print(f"Data shape: {df_specific.shape}")
print(f"✓ Total: {len(df_specific)} experimental points")