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:
- Minimalism: Minimize wasted time and effort, with a focus on reducing boilerplate code and offering advanced capabilities.
- 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.
- 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 nestedforloops. Operates on in-memory variables only (no file IO) just like standard functions.scidb: Wrapsscifor, adds a SQL database for data save/load and an auditable data processing historyscistackGUI: Wrapsscidb, 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:
- Defined a
scifor.PathInput, providing a template to load all of the files of interest. - Invoked the main command
scifor.for_each(), providingload_dataas the function,file_pathas the input variable, and specifying to runload_dataonce over every combination ofsubject,session, andtrialthat match thescifor.PathInputpath template. loaded_dfis apd.DataFramewith one row persubject,session, andtrialcombination. The data is stored into the"Loaded"field specified in the optionaloutput_namesparameter (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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scistack-0.1.29.tar.gz.
File metadata
- Download URL: scistack-0.1.29.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d726ce1d5d4a45a7e55bdc0c9b7e502e08f2b8be27754fc11a66d88f47724e87
|
|
| MD5 |
6870c46817d234b848376778c21a5691
|
|
| BLAKE2b-256 |
cfd7bcd700a07e007c0e340c436a126b5bce7a4ca643b2f33f40b486eda3a8b1
|
Provenance
The following attestation bundles were made for scistack-0.1.29.tar.gz:
Publisher:
publish.yml on mtillman14/scistack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scistack-0.1.29.tar.gz -
Subject digest:
d726ce1d5d4a45a7e55bdc0c9b7e502e08f2b8be27754fc11a66d88f47724e87 - Sigstore transparency entry: 2824335403
- Sigstore integration time:
-
Permalink:
mtillman14/scistack@9787b3b47c902d03cc6556ccdb5f86535d333680 -
Branch / Tag:
refs/tags/v0.1.29 - Owner: https://github.com/mtillman14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9787b3b47c902d03cc6556ccdb5f86535d333680 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scistack-0.1.29-py3-none-any.whl.
File metadata
- Download URL: scistack-0.1.29-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92c6657cb62426532d6e97c3ea5ba2d52a004ab1f90bf17bc5cf0abd5b618b93
|
|
| MD5 |
55d4324c85f654264dc90680a2050b02
|
|
| BLAKE2b-256 |
91b2da8326958b648650286f526e98c0ac3246199ea53027e485dd0690c04cda
|
Provenance
The following attestation bundles were made for scistack-0.1.29-py3-none-any.whl:
Publisher:
publish.yml on mtillman14/scistack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scistack-0.1.29-py3-none-any.whl -
Subject digest:
92c6657cb62426532d6e97c3ea5ba2d52a004ab1f90bf17bc5cf0abd5b618b93 - Sigstore transparency entry: 2824336939
- Sigstore integration time:
-
Permalink:
mtillman14/scistack@9787b3b47c902d03cc6556ccdb5f86535d333680 -
Branch / Tag:
refs/tags/v0.1.29 - Owner: https://github.com/mtillman14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9787b3b47c902d03cc6556ccdb5f86535d333680 -
Trigger Event:
push
-
Statement type: