pyspi: Statistics for Pairwise Interactions
pyspi GitHub
  • Welcome to pyspi
    • Citing pyspi
  • Installing and using pyspi
    • Installation
      • Alternative Installation Options
      • Troubleshooting
    • Usage
      • Walkthrough Tutorials
        • Getting Started: A Simple Demonstration
        • Neuroimaging: fMRI Time Series
        • Finance: Stock Price Time Series
        • Distributing Calculations
      • Advanced Usage
        • Creating a reduced SPI set
        • Distributing calculations on a cluster
      • FAQ
  • Information about pyspi
    • SPIs
      • Glossary of Terms
      • Table of SPIs
      • SPI Descriptions
        • Basic Statistics
        • Distance Similarity
        • Causal Inference
        • Information Theory
        • Spectral
        • Miscellaneous
      • SPI Subsets
    • API Reference
      • pyspi.calculator.CorrelationFrame
      • pyspi.calculator.Calculator
      • pyspi.data.Data
      • pyspi.calculator.CalculatorFrame
      • pyspi.utils.filter_spis
    • Publications using pyspi
    • Related Packages
  • Development
    • Development
      • Incorporating new SPIs
      • Contributing to pyspi
      • Code of Conduct
    • License
Powered by GitBook

All page cover images on this wiki are created with the help of DALL-E, an AI program developed by OpenAI, or stock images from Unsplash.

On this page
  • filter_spis(keywords: list, output_name: str = None, configfile: str = None)
  • Example
  • Parameters:
  • Returns
  • Raises:
  1. Information about pyspi
  2. API Reference

pyspi.utils.filter_spis

Previouspyspi.calculator.CalculatorFrameNextPublications using pyspi

Last updated 1 year ago

filter_spis(keywords: , output_name: = None, configfile: = None)

Filter a pyspi config YAML file using a list of keywords and return a new YAML file containing the reduced set of SPIs in the current working directory.

Example

from pyspi.utils import filter_spis

# using a user-specified source config file
filter_spis(["linear"], "linear_spis", "./myconfig.yaml")

# using the default config file in the pyspi dir
filter_spis(["linear"], "linear_spis")

# using a randomly generated name and default config file
filter_spis(["linear"]")

Parameters:

Parameter
Type
Description

keywords

List of keywords used to filter SPIs e.g., linear, nonlinear, signed.

output_name

Name of the filtered YAML file to be saved in the current working directory. If no name is provided, a randomly generated name will be used.

configfile

Location of the source config file from which to filter SPIs. If no source file is provided, the config.yaml in the pyspi directory will be used.

Returns

Nothing - A new file is created in the current working directory.

Raises:

  • ValueError: Raised in three scenarios:

    • If the keywords parameter is not a list.

    • If any of the provided keywords is not a string.

    • If no SPIs match the specified keywords.

  • FileNotFoundError: Triggered if the specified configfile cannot be found or if the default config.yaml is not present in the expected directory.

  • OError: Occurs if there's an error reading the specified YAML file.

, optional

, optional

list
str
str
Page cover image
list
str
str