Skip to main content

SciStack

pip install scistack # Installs tools for Python and MATLAB

Better Research Tools, Better Research Outcomes

SciStack is a suite of tools built by scientists for scientists of nearly any discipline to enhance data analysis pipelines. SciStack focuses on the common case of embarrassingly parallel workflows used to process nested datasets. It has three core goals:

  1. Minimalism: Minimize wasted time and effort, with a focus on reducing boilerplate code and offering advanced capabilities.
  2. Reusability: With a near-zero boilerplate format and support for cookie-cutter pipelines, SciStack pipelines are highly interoperable between projects. Thus, SciStack encourages scientific code reuse, an essential yet underutilized scientific work product.
  3. Openness: Minimize lock-in to the SciStack framework. SciStack code never touches scientific code, so you can easily change your data processing pipeline architecture at any time.

Minimal Example

Imagine that I am running a study involving a dataset containing Subjects each performing multiple Conditions, and each Condition contains multiple Trials (a common setup in my home field of biomechanics). Below is an example minimal data processing pipeline showcasing SciStack's features.

import scifor
import numpy as np
import pandas as pd

schema = ["subject", "condition", "trial"] # The structure of the dataset
scifor.set_schema(schema) # Tell SciStack about the schema

def example_loading_function(filepath: str) -> np.ndarray:
  """Data loading logic here."""
  return np.ndarray(pd.read_csv(filepath))

def example_processing_function(val: np.ndarray, const: float) -> np.ndarray:
  """Do some processing on some inputs."""
  return val + const

# Load every file matching "path/to/{subject}/{condition}/{trial}_data.ext"
# Returns a df with columns ["subject", "condition", "trial", "loaded_variable"]
loaded_df = scifor.for_each(example_loading_function,
  filepath=scifor.PathInput("path/to/{subject}/{condition}/{trial}_data.ext"),
  outputs=["loaded_variable"]
)

# Process every subject, condition, & trial combination.
# Returns a df with columns ["subject", "condition", "trial", "procesed_variable"]
processed_df = scifor.for_each(example_processing_function,
  val=scifor.ColumnSelection(loaded_df, "variable_to_process"), const=5,
  subject=[], condition=[], trial=[], # Tell SciStack that `my_processing_function` should receive only one trial's data at a time.
  outputs=["processed_variable"]
)

SciStack Design

For any project, it's essential to pick the right tool for the job. SciStack - as the name implies - contains a suite of tools in a "stack" of increasing complexity and weight. There are three main tools in this stack:

  • scifor: The lightest-weight level. Syntactical sugar around nested for loops. Operates on in-memory variables only (no file IO) just like standard functions.
  • scidb: Wraps scifor, adds a SQL database for data save/load and an auditable data processing history
  • scistack GUI: Wraps scidb, adds a GUI to manage complex pipelines.

scifor: syntactic sugar around for loops

Imagine you are conducting a study of human subjects walking. Each Subject comes in to the lab for multiple Sessions, and in each Session they perform multiple Trials of walking. During each Trial, you measure their speed every 0.1 seconds and store that data to one .csv file for each trial.

Example scifor Pipeline Data Loading Step

import scifor
import pandas as pd

# Tell `scifor` about the structure of this dataset
scifor.set_schema(["subject", "session", "trial"]) # ordered one-to-many

def load_data(file_path: str) -> pd.DataFrame:
    """Example logic to load the data"""
    return pd.read_csv(file_path)

path_template = scifor.PathInput("path/to/data/{subject}/{session}/{trial}.csv")
loaded_df = scifor.for_each(load_data,
    file_path=path_template,
    subject=[], session=[], trial=[],
    output_names=["Loaded"]
)

In this example step, after defining a basic load_data() function, we:

  1. Defined a scifor.PathInput, providing a template to load all of the files of interest.
  2. Invoked the main command scifor.for_each(), providing load_data as the function, file_path as the input variable, and specifying to run load_data once over every combination of subject, session, and trial that match the scifor.PathInput path template.
  3. loaded_df is a pd.DataFrame with one row per subject, session, and trial combination. The data is stored into the "Loaded" field specified in the optional output_names parameter (default output name: "value").

Example scifor Pipeline Data Processing Step

import numpy as np

def process_data(speed: np.ndarray) -> np.ndarray:
    """Square every data point"""
    return np.square(speed)

squared_df = scifor.for_each(process_data,
    speed=loaded_df,
    subject=[], session=[], trial=[]
)

scifor.for_each automatically parses loaded_df, repeatedly inputting only the speed values for one combination of subject, session, trial, allowing process_data() to remain very simple and ignore the structure of this project's dataset.

To see more, refer to the scifor docs.

scidb

scistack GUI

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scistack-0.1.26.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scistack-0.1.26-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file scistack-0.1.26.tar.gz.

File metadata

  • Download URL: scistack-0.1.26.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scistack-0.1.26.tar.gz
Algorithm Hash digest
SHA256 f3fb50d0d1647c172958585698e6beaeff5fc60a8b571f4af48804aa9c080ca3
MD5 bc12d00e3407b119376cee4795378197
BLAKE2b-256 64f73f1c7f22ea0cf4752b07bf4937282808f92d87ec1b65686493bc7e0084af

See more details on using hashes here.

Provenance

The following attestation bundles were made for scistack-0.1.26.tar.gz:

Publisher: publish.yml on mtillman14/scistack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scistack-0.1.26-py3-none-any.whl.

File metadata

  • Download URL: scistack-0.1.26-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scistack-0.1.26-py3-none-any.whl
Algorithm Hash digest
SHA256 d4f4e90d16af361eda1086d9f7f925ebc7fee3808df7d5e5e1fede752fc6e9e9
MD5 a2462ed5ac76997975d4d8d805f8d407
BLAKE2b-256 b503d65dd62c77b49feee4ac20fda3da33acf2ead06ef83e19112fc8d26c95d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for scistack-0.1.26-py3-none-any.whl:

Publisher: publish.yml on mtillman14/scistack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.29

2 files

0.1.28

2 files

This release

0.1.26 This release

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.14

2 files

0.1.13

2 files

0.1.11

2 files

0.1.10

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page