Dependency Guide#

Polars#

Polars is the most important dependency in PyProBE. It provides all of the back-end data storage and manipulation through LazyFrames and DataFrames. The principle of Lazy evaluation is critical to the performance of PyProBE. The polars expression framework is used throughout PyProBE as it allows multiple commands to be chained together. PyProBE constructs this chain of commands as the user filters the data, which is only executed when the final result is requested from the user. This might be to print, plot or perform analysis on the data with the analysis module.

The performance of PyProBE is demonstrated in the Comparing PyProBE Performance example.

Pydantic#

Pydantic is used across PyProBE for class and function input validation. Result, RawData and all of the classes in the filters module inherit from Pydantic BaseModel. This means all of their inputs are type-validated automatically.

Functions in the analysis module use the validate_call decorator, to ensure the arguments passed are of the correct type. The AnalysisValidator is a custom validation model for checking the type and columns are correct for methods of analysis classes.

Most of this work is behind-the-scenes. Your main interaction with Pydantic is likely to be when contributing to the analysis module, so follow this guide to set it up correctly.

Examples of the causes of Pydantic validation errors can be found in the Providing Valid Inputs. example.