Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/ipython@9.5.x
tile.json

tessl/pypi-ipython

tessl install tessl/pypi-ipython@9.5.0

IPython: Productive Interactive Computing - An advanced interactive computing environment and command shell for Python.

Agent Success

Agent success rate when using this tile

86%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.09x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-2/

IPython Profile Configuration Generator

Overview

Build a Python application that generates custom IPython configuration profiles for different development environments (development, production, and testing). The application should create profile directories with properly configured settings that control IPython's interactive behavior.

Requirements

Profile Management

Your application should support three distinct profiles:

  1. Development Profile: Optimized for interactive development with verbose output and auto-reloading
  2. Production Profile: Minimal output, no auto-suggestions, optimized for scripting
  3. Testing Profile: Configured for reproducible test execution with disabled history

Configuration Options

Each profile must configure the following IPython behaviors:

  1. Display Settings

    • Maximum number of items to display for collections (lists, dicts, etc.)
    • Whether to show detailed traceback information
    • Color scheme selection (NoColor, Linux, or Neutral)
  2. Auto-completion and Suggestions

    • Enable or disable auto-suggestions
    • Configure completion type (column, multicolumn, or readlinelike)
    • Set greedy completion behavior
  3. History Management

    • Enable or disable history saving
    • Configure history length limits
    • Control whether to save duplicate entries
  4. Execution Behavior

    • Set autoindent behavior
    • Configure whether to confirm exit
    • Enable or disable automagic (magics without % prefix)

Implementation Specifications

Create a Python module profile_generator.py with the following:

  1. A ProfileConfig class that holds configuration settings for a profile

  2. A generate_profile(profile_name: str, config: ProfileConfig, output_dir: str) -> None function that:

    • Creates the profile directory structure
    • Generates a valid IPython configuration file
    • Writes the configuration with proper Python syntax
  3. Profile-specific configurations:

    • Development: Max display items=100, colored tracebacks (Linux scheme), auto-suggestions enabled, history enabled with 10000 entries, autoindent enabled, no exit confirmation, automagic enabled
    • Production: Max display items=20, no color (NoColor scheme), auto-suggestions disabled, history disabled, autoindent disabled, exit confirmation enabled, automagic disabled
    • Testing: Max display items=50, colored tracebacks (Neutral scheme), auto-suggestions disabled, history disabled, autoindent enabled, no exit confirmation, automagic disabled

Output Format

The generated configuration file should be valid Python code that IPython can load. Use the proper IPython configuration object structure (accessing c.InteractiveShell and related trait objects).

Dependencies { .dependencies }

IPython { .dependency }

Provides the interactive Python environment and configuration system. Use the traitlets-based configuration to control IPython behavior.

Test Cases

Test 1: Development Profile Generation { .test @test }

Input: Generate a development profile

config = ProfileConfig(
    max_display_items=100,
    color_scheme='Linux',
    auto_suggestions=True,
    history_enabled=True,
    history_length=10000,
    autoindent=True,
    confirm_exit=False,
    automagic=True
)
generate_profile('profile_dev', config, '/tmp/test_profiles')

Expected Output:

  • Directory /tmp/test_profiles/profile_dev is created
  • File /tmp/test_profiles/profile_dev/ipython_config.py exists
  • Configuration file contains proper settings for all specified options
  • IPython can successfully load the profile without errors

Test 2: Production Profile Generation { .test @test }

Input: Generate a production profile with minimal features

config = ProfileConfig(
    max_display_items=20,
    color_scheme='NoColor',
    auto_suggestions=False,
    history_enabled=False,
    autoindent=False,
    confirm_exit=True,
    automagic=False
)
generate_profile('profile_prod', config, '/tmp/test_profiles')

Expected Output:

  • Directory /tmp/test_profiles/profile_prod is created
  • Configuration disables auto-suggestions, history, and automagic
  • Color scheme is set to NoColor
  • Exit confirmation is enabled

Test 3: Testing Profile Generation { .test @test }

Input: Generate a testing profile for reproducible test runs

config = ProfileConfig(
    max_display_items=50,
    color_scheme='Neutral',
    auto_suggestions=False,
    history_enabled=False,
    autoindent=True,
    confirm_exit=False,
    automagic=False
)
generate_profile('profile_test', config, '/tmp/test_profiles')

Expected Output:

  • Directory /tmp/test_profiles/profile_test is created
  • History is disabled for reproducibility
  • Neutral color scheme is configured
  • Auto-suggestions and automagic are disabled

Testing

Create a test file test_profile_generator.py that validates:

  1. Profile directories are created correctly
  2. Configuration files are valid Python
  3. Generated profiles can be loaded by IPython
  4. Configuration values match the specified settings

Run tests using pytest:

pytest test_profile_generator.py -v