Skip to main content

epicpydevicelib

A Python library providing base classes and utilities for writing devices and encoders for EPICpy, a Python-based cognitive modeling environment built on the EPIC (Executive Process Interactive Control) architecture (Meyer & Kieras 1997).

Overview

epicpydevicelib provides the foundational components needed to create simulated task environments (devices) that interact with EPIC's simulated human. It wraps the C++ EPIClib bindings and offers a Pythonic interface for:

  • Device development - Create task environments that present stimuli and respond to simulated human actions
  • Visual/Auditory encoders - Customize how sensory information is encoded before reaching the cognitive model
  • Data collection - Built-in CSV output for recording experimental data
  • Statistical analysis - Accumulators for means, proportions, distributions, correlations, and goodness-of-fit metrics

Installation

pip install epicpydevicelib

Or with uv:

uv add epicpydevicelib

Requirements

  • Python 3.11 - 3.14
  • epiclibcpp - Python bindings for EPIClib

Quick Start

Creating a Device

Subclass EpicPyDevice to create a task environment:

from pathlib import Path
from epicpydevicelib.epicpy_device_base import EpicPyDevice
from epiclibcpp.epiclib import Output_tee, Symbol

class MyDevice(EpicPyDevice):
    def __init__(self, ot: Output_tee, device_name: str, device_folder: Path):
        super().__init__(ot, device_name, device_folder)

        # Define data output columns
        self.data_header = ("trial", "response", "rt", "correct")

    def handle_Start_event(self):
        """Called when simulation starts"""
        self.init_data_output()
        # Present initial stimulus
        self.make_visual_object_appear(Symbol("Stimulus1"))

    def handle_Keystroke_event(self, key_name: Symbol):
        """Called when simulated human presses a key"""
        # Record response and provide feedback
        self.data_writer.writerow((self.trial, str(key_name), self.rt, self.correct))

Creating a Visual Encoder

Customize visual encoding by subclassing EPICPyVisualEncoder:

from epicpydevicelib.epicpy_visual_encoder_base import EPICPyVisualEncoder
from epiclibcpp.epiclib import Symbol

class MyVisualEncoder(EPICPyVisualEncoder):
    def __init__(self):
        super().__init__("MyVisualEncoder")

    def set_object_property(self, object_name, property_name, property_value, encoding_time):
        # Custom encoding logic here
        encoded_value = self.encode(property_value)
        self.schedule_change_property_event(encoding_time, object_name, property_name, encoded_value)
        return True

Key Components

Device Base Class

EpicPyDevice provides:

  • Event handlers - Override methods like handle_Keystroke_event(), handle_Click_event(), handle_Vocal_event() to respond to simulated human actions
  • Stimulus presentation - Methods like make_visual_object_appear(), set_visual_object_property(), make_auditory_speech_event()
  • Data output - Automatic CSV file management with init_data_output(), finalize_data_output()
  • Stats output - stats_write() accepts strings, matplotlib figures, or pandas DataFrames
  • Condition strings - Parse experimental conditions with get_param_list()

Encoder Base Classes

  • EPICPyVisualEncoder - Base for custom visual encoders
  • EPICPyAuditoryEncoder - Base for custom auditory encoders

Utilities

  • Symbols - Symbol class and utilities for EPIC's symbolic representation
  • Geometry - Point, Size, Polar_vector for spatial computations
  • Statistics - Mean_accumulator, Proportion_accumulator, Distribution_accumulator, Correl_accumulator, PredObs_accumulator
  • Speech - Speech_word for auditory speech events
  • EPICpy - The main EPICpy simulation environment
  • EPICpyDevices - Example devices built with this library
  • epiclibcpp - Python bindings for the EPIC C++ library

License

GNU General Public License v3 (GPLv3)

Author

Travis Seymour (nogard@ucsc.edu)

Metadata

Release files for epicpydevicelib 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for epicpydevicelib 0.1.3
File Size Uploaded Provenance Actions
epicpydevicelib-0.1.3.tar.gz 61.7 kB Without provenance Details for epicpydevicelib-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for epicpydevicelib 0.1.3
File Interpreter ABI Platform Actions
epicpydevicelib-0.1.3-py3-none-any.whl Python 3 none any Details for epicpydevicelib-0.1.3-py3-none-any.whl

Total release size: 115.0 kB

Release files / epicpydevicelib-0.1.3.tar.gz

Download URL epicpydevicelib-0.1.3.tar.gz
Size 61.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fc5cd4578d0bd55e142cc128e9e12b1c4c8fdfc965fbdab67fd49b2ca04fd612
BLAKE2b-256 checksum
How to use checksums
cf55ca1f7f8ed1528243cd005825c890322860c7855a70741b8e7c1dffa52454
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / epicpydevicelib-0.1.3-py3-none-any.whl

Download URL epicpydevicelib-0.1.3-py3-none-any.whl
Size 53.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b96fceed3f7c027d8778aa536e892b759778d470a5915f46612df812865d047
BLAKE2b-256 checksum
How to use checksums
a470bfaaa3f7fa28178f7bd8c962b52bb5d818d8c6197625d4bf4be5d7f91127
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for epicpydevicelib 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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