bayesflow-testing

Test BayesFlow extension packages with simulator output and adapter pipeline validation.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/matthiaskloft/claude-skills --skill bayesflow-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bayesflow-testing
Source: https://github.com/matthiaskloft/claude-skills/tree/main/bayesflow/skills/bayesflow-testing
Command: npx skills add https://github.com/matthiaskloft/claude-skills --skill bayesflow-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides patterns and best practices for writing effective unit and integration tests for BayesFlow extension packages, ensuring code quality and reliability.

Core Features & Use Cases

  • Test Structure Guidance: Offers a clear directory layout mirroring the source code.
  • Shape and Output Validation: Demonstrates how to test simulator outputs and adapter pipelines.
  • Mocking Strategies: Shows how to mock inference and summary networks for isolated testing.
  • Use Case: When developing a new simulator for BayesFlow, use this Skill's patterns to write tests that verify its output shapes and data types, preventing subtle bugs.

Quick Start

Use the bayesflow-testing skill to write a test for a simulator's output shapes.

Frequently Asked Questions about bayesflow-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for BayesFlow simulator outputs?

You can test BayesFlow adapter pipelines by implementing configuration roundtrip checks that validate data transformations. These tests ensure your adapter correctly processes simulator outputs and maintains expected shapes throughout the pipeline stages.

How do I mock inference networks for isolated testing in BayesFlow?

Mocking inference networks in BayesFlow involves replacing summary and inference networks with mock objects to isolate testing. This strategy allows you to verify the behavior of surrounding components without the computational overhead of running actual network forward passes.

How do I set up deterministic RNG for BayesFlow tests in a CI matrix?

Setting up deterministic RNG for BayesFlow tests in a CI matrix requires configuring fixed random seeds within your pytest conftest setup. This ensures reproducible test execution across different environments and prevents flaky tests caused by stochastic simulator behavior.

What is the best way to structure a BayesFlow extension package test directory?

The best way to structure a BayesFlow extension package test directory is to mirror the source code layout directly. This clear directory organization ensures that every module has corresponding tests, making it easier to locate and maintain unit and integration tests.

What are common pitfalls when testing scientific computing libraries with pytest?

Common pitfalls when testing scientific computing libraries with pytest include neglecting deterministic RNG setup and failing to validate simulator output shapes. Addressing these issues requires configuring fixed seeds and implementing strict data type checks to avoid flaky and misleading test results.