dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

ipython_config.py (22060B)


      1 # Configuration file for ipython.
      2 
      3 #------------------------------------------------------------------------------
      4 # InteractiveShellApp(Configurable) configuration
      5 #------------------------------------------------------------------------------
      6 
      7 ## A Mixin for applications that start InteractiveShell instances.
      8 #
      9 #  Provides configurables for loading extensions and executing files as part of
     10 #  configuring a Shell environment.
     11 #
     12 #  The following methods should be called by the :meth:`initialize` method of the
     13 #  subclass:
     14 #
     15 #    - :meth:`init_path`
     16 #    - :meth:`init_shell` (to be implemented by the subclass)
     17 #    - :meth:`init_gui_pylab`
     18 #    - :meth:`init_extensions`
     19 #    - :meth:`init_code`
     20 
     21 ## Execute the given command string.
     22 #c.InteractiveShellApp.code_to_run = ''
     23 
     24 ## Run the file referenced by the PYTHONSTARTUP environment variable at IPython
     25 #  startup.
     26 #c.InteractiveShellApp.exec_PYTHONSTARTUP = True
     27 
     28 ## List of files to run at IPython startup.
     29 #c.InteractiveShellApp.exec_files = []
     30 
     31 ## lines of code to run at IPython startup.
     32 #c.InteractiveShellApp.exec_lines = []
     33 
     34 ## A list of dotted module names of IPython extensions to load.
     35 #c.InteractiveShellApp.extensions = []
     36 
     37 ## dotted module name of an IPython extension to load.
     38 #c.InteractiveShellApp.extra_extension = ''
     39 
     40 ## A file to be run
     41 #c.InteractiveShellApp.file_to_run = ''
     42 
     43 ## Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk2', 'gtk3',
     44 #  'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', 'qt4').
     45 #c.InteractiveShellApp.gui = None
     46 
     47 ## Should variables loaded at startup (by startup files, exec_lines, etc.) be
     48 #  hidden from tools like %who?
     49 #c.InteractiveShellApp.hide_initial_ns = True
     50 
     51 ## Configure matplotlib for interactive use with the default matplotlib backend.
     52 #c.InteractiveShellApp.matplotlib = None
     53 
     54 ## Run the module as a script.
     55 #c.InteractiveShellApp.module_to_run = ''
     56 
     57 ## Pre-load matplotlib and numpy for interactive use, selecting a particular
     58 #  matplotlib backend and loop integration.
     59 #c.InteractiveShellApp.pylab = None
     60 
     61 ## If true, IPython will populate the user namespace with numpy, pylab, etc. and
     62 #  an ``import *`` is done from numpy and pylab, when using pylab mode.
     63 #
     64 #  When False, pylab mode should not import any names into the user namespace.
     65 #c.InteractiveShellApp.pylab_import_all = True
     66 
     67 ## Reraise exceptions encountered loading IPython extensions?
     68 #c.InteractiveShellApp.reraise_ipython_extension_failures = False
     69 
     70 #------------------------------------------------------------------------------
     71 # Application(SingletonConfigurable) configuration
     72 #------------------------------------------------------------------------------
     73 
     74 ## This is an application.
     75 
     76 ## The date format used by logging formatters for %(asctime)s
     77 #c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
     78 
     79 ## The Logging format template
     80 #c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
     81 
     82 ## Set the log level by value or name.
     83 #c.Application.log_level = 30
     84 
     85 #------------------------------------------------------------------------------
     86 # BaseIPythonApplication(Application) configuration
     87 #------------------------------------------------------------------------------
     88 
     89 ## IPython: an enhanced interactive Python shell.
     90 
     91 ## Whether to create profile dir if it doesn't exist
     92 #c.BaseIPythonApplication.auto_create = False
     93 
     94 ## Whether to install the default config files into the profile dir. If a new
     95 #  profile is being created, and IPython contains config files for that profile,
     96 #  then they will be staged into the new directory.  Otherwise, default config
     97 #  files will be automatically generated.
     98 #c.BaseIPythonApplication.copy_config_files = False
     99 
    100 ## Path to an extra config file to load.
    101 #
    102 #  If specified, load this config file in addition to any other IPython config.
    103 #c.BaseIPythonApplication.extra_config_file = u''
    104 
    105 ## The name of the IPython directory. This directory is used for logging
    106 #  configuration (through profiles), history storage, etc. The default is usually
    107 #  $HOME/.ipython. This option can also be specified through the environment
    108 #  variable IPYTHONDIR.
    109 #c.BaseIPythonApplication.ipython_dir = u''
    110 
    111 ## Whether to overwrite existing config files when copying
    112 #c.BaseIPythonApplication.overwrite = False
    113 
    114 ## The IPython profile to use.
    115 #c.BaseIPythonApplication.profile = u'default'
    116 
    117 ## Create a massive crash report when IPython encounters what may be an internal
    118 #  error.  The default is to append a short message to the usual traceback
    119 #c.BaseIPythonApplication.verbose_crash = False
    120 
    121 #------------------------------------------------------------------------------
    122 # TerminalIPythonApp(BaseIPythonApplication,InteractiveShellApp) configuration
    123 #------------------------------------------------------------------------------
    124 
    125 ## Whether to display a banner upon starting IPython.
    126 #c.TerminalIPythonApp.display_banner = True
    127 
    128 ## If a command or file is given via the command-line, e.g. 'ipython foo.py',
    129 #  start an interactive shell after executing the file or command.
    130 #c.TerminalIPythonApp.force_interact = False
    131 
    132 ## Start IPython quickly by skipping the loading of config files.
    133 #c.TerminalIPythonApp.quick = False
    134 
    135 #------------------------------------------------------------------------------
    136 # InteractiveShell(SingletonConfigurable) configuration
    137 #------------------------------------------------------------------------------
    138 
    139 ## An enhanced, interactive shell for Python.
    140 
    141 ## 'all', 'last', 'last_expr' or 'none', specifying which nodes should be run
    142 #  interactively (displaying output from expressions).
    143 #c.InteractiveShell.ast_node_interactivity = 'last_expr'
    144 
    145 ## A list of ast.NodeTransformer subclass instances, which will be applied to
    146 #  user input before code is run.
    147 #c.InteractiveShell.ast_transformers = []
    148 
    149 ## Make IPython automatically call any callable object even if you didn't type
    150 #  explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically.
    151 #  The value can be '0' to disable the feature, '1' for 'smart' autocall, where
    152 #  it is not applied if there are no more arguments on the line, and '2' for
    153 #  'full' autocall, where all callable objects are automatically called (even if
    154 #  no arguments are present).
    155 #c.InteractiveShell.autocall = 0
    156 
    157 ## Autoindent IPython code entered interactively.
    158 #c.InteractiveShell.autoindent = True
    159 
    160 ## Enable magic commands to be called without the leading %.
    161 #c.InteractiveShell.automagic = True
    162 
    163 ## The part of the banner to be printed before the profile
    164 #c.InteractiveShell.banner1 = 'Python 2.7.13 (default, Dec 18 2016, 07:03:39) \nType "copyright", "credits" or "license" for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython\'s features.\n%quickref -> Quick reference.\nhelp      -> Python\'s own help system.\nobject?   -> Details about \'object\', use \'object??\' for extra details.\n'
    165 
    166 ## The part of the banner to be printed after the profile
    167 #c.InteractiveShell.banner2 = ''
    168 
    169 ## Set the size of the output cache.  The default is 1000, you can change it
    170 #  permanently in your config file.  Setting it to 0 completely disables the
    171 #  caching system, and the minimum value accepted is 20 (if you provide a value
    172 #  less than 20, it is reset to 0 and a warning is issued).  This limit is
    173 #  defined because otherwise you'll spend more time re-flushing a too small cache
    174 #  than working
    175 #c.InteractiveShell.cache_size = 1000
    176 
    177 ## Use colors for displaying information about objects. Because this information
    178 #  is passed through a pager (like 'less'), and some pagers get confused with
    179 #  color codes, this capability can be turned off.
    180 #c.InteractiveShell.color_info = True
    181 
    182 ## Set the color scheme (NoColor, Neutral, Linux, or LightBG).
    183 #c.InteractiveShell.colors = 'Neutral'
    184 
    185 ##
    186 #c.InteractiveShell.debug = False
    187 
    188 ## **Deprecated**
    189 #
    190 #  Will be removed in IPython 6.0
    191 #
    192 #  Enable deep (recursive) reloading by default. IPython can use the deep_reload
    193 #  module which reloads changes in modules recursively (it replaces the reload()
    194 #  function, so you don't need to change anything to use it). `deep_reload`
    195 #  forces a full reload of modules whose code may have changed, which the default
    196 #  reload() function does not.  When deep_reload is off, IPython will use the
    197 #  normal reload(), but deep_reload will still be available as dreload().
    198 #c.InteractiveShell.deep_reload = False
    199 
    200 ## Don't call post-execute functions that have failed in the past.
    201 #c.InteractiveShell.disable_failing_post_execute = False
    202 
    203 ## If True, anything that would be passed to the pager will be displayed as
    204 #  regular output instead.
    205 #c.InteractiveShell.display_page = False
    206 
    207 ## (Provisional API) enables html representation in mime bundles sent to pagers.
    208 #c.InteractiveShell.enable_html_pager = False
    209 
    210 ## Total length of command history
    211 #c.InteractiveShell.history_length = 10000
    212 
    213 ## The number of saved history entries to be loaded into the history buffer at
    214 #  startup.
    215 #c.InteractiveShell.history_load_length = 1000
    216 
    217 ##
    218 #c.InteractiveShell.ipython_dir = ''
    219 
    220 ## Start logging to the given file in append mode. Use `logfile` to specify a log
    221 #  file to **overwrite** logs to.
    222 #c.InteractiveShell.logappend = ''
    223 
    224 ## The name of the logfile to use.
    225 #c.InteractiveShell.logfile = ''
    226 
    227 ## Start logging to the default log file in overwrite mode. Use `logappend` to
    228 #  specify a log file to **append** logs to.
    229 #c.InteractiveShell.logstart = False
    230 
    231 ##
    232 #c.InteractiveShell.object_info_string_level = 0
    233 
    234 ## Automatically call the pdb debugger after every exception.
    235 #c.InteractiveShell.pdb = False
    236 
    237 ## Deprecated since IPython 4.0 and ignored since 5.0, set
    238 #  TerminalInteractiveShell.prompts object directly.
    239 #c.InteractiveShell.prompt_in1 = 'In [\\#]: '
    240 
    241 ## Deprecated since IPython 4.0 and ignored since 5.0, set
    242 #  TerminalInteractiveShell.prompts object directly.
    243 #c.InteractiveShell.prompt_in2 = '   .\\D.: '
    244 
    245 ## Deprecated since IPython 4.0 and ignored since 5.0, set
    246 #  TerminalInteractiveShell.prompts object directly.
    247 #c.InteractiveShell.prompt_out = 'Out[\\#]: '
    248 
    249 ## Deprecated since IPython 4.0 and ignored since 5.0, set
    250 #  TerminalInteractiveShell.prompts object directly.
    251 #c.InteractiveShell.prompts_pad_left = True
    252 
    253 ##
    254 #c.InteractiveShell.quiet = False
    255 
    256 ##
    257 #c.InteractiveShell.separate_in = '\n'
    258 
    259 ##
    260 #c.InteractiveShell.separate_out = ''
    261 
    262 ##
    263 #c.InteractiveShell.separate_out2 = ''
    264 
    265 ## Show rewritten input, e.g. for autocall.
    266 #c.InteractiveShell.show_rewritten_input = True
    267 
    268 ## Enables rich html representation of docstrings. (This requires the docrepr
    269 #  module).
    270 #c.InteractiveShell.sphinxify_docstring = False
    271 
    272 ##
    273 #c.InteractiveShell.wildcards_case_sensitive = True
    274 
    275 ##
    276 #c.InteractiveShell.xmode = 'Context'
    277 
    278 #------------------------------------------------------------------------------
    279 # TerminalInteractiveShell(InteractiveShell) configuration
    280 #------------------------------------------------------------------------------
    281 
    282 ## Set to confirm when you try to exit IPython with an EOF (Control-D in Unix,
    283 #  Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a
    284 #  direct exit without any confirmation.
    285 #c.TerminalInteractiveShell.confirm_exit = True
    286 
    287 ## Options for displaying tab completions, 'column', 'multicolumn', and
    288 #  'readlinelike'. These options are for `prompt_toolkit`, see `prompt_toolkit`
    289 #  documentation for more information.
    290 #c.TerminalInteractiveShell.display_completions = 'multicolumn'
    291 
    292 ## Shortcut style to use at the prompt. 'vi' or 'emacs'.
    293 #c.TerminalInteractiveShell.editing_mode = 'emacs'
    294 c.TerminalInteractiveShell.editing_mode = 'vi'
    295 
    296 ## Set the editor used by IPython (default to $EDITOR/vi/notepad).
    297 #c.TerminalInteractiveShell.editor = u'vim'
    298 
    299 ## Highlight matching brackets .
    300 #c.TerminalInteractiveShell.highlight_matching_brackets = True
    301 
    302 ## The name of a Pygments style to use for syntax highlighting:  manni, igor,
    303 #  lovelace, xcode, vim, autumn, abap, vs, rrt, native, perldoc, borland,
    304 #  arduino, tango, emacs, friendly, monokai, paraiso-dark, colorful, murphy, bw,
    305 #  pastie, rainbow_dash, algol_nu, paraiso-light, trac, default, algol, fruity
    306 #c.TerminalInteractiveShell.highlighting_style = 'legacy'
    307 
    308 ## Override highlighting format for specific tokens
    309 #c.TerminalInteractiveShell.highlighting_style_overrides = {}
    310 
    311 ## Enable mouse support in the prompt
    312 #c.TerminalInteractiveShell.mouse_support = False
    313 
    314 ## Class used to generate Prompt token for prompt_toolkit
    315 #c.TerminalInteractiveShell.prompts_class = 'IPython.terminal.prompts.Prompts'
    316 
    317 ## Use `raw_input` for the REPL, without completion, multiline input, and prompt
    318 #  colors.
    319 #
    320 #  Useful when controlling IPython as a subprocess, and piping STDIN/OUT/ERR.
    321 #  Known usage are: IPython own testing machinery, and emacs inferior-shell
    322 #  integration through elpy.
    323 #
    324 #  This mode default to `True` if the `IPY_TEST_SIMPLE_PROMPT` environment
    325 #  variable is set, or the current terminal is not a tty.
    326 #c.TerminalInteractiveShell.simple_prompt = False
    327 
    328 ## Number of line at the bottom of the screen to reserve for the completion menu
    329 #c.TerminalInteractiveShell.space_for_menu = 6
    330 
    331 ## Automatically set the terminal title
    332 #c.TerminalInteractiveShell.term_title = True
    333 
    334 ## Use 24bit colors instead of 256 colors in prompt highlighting. If your
    335 #  terminal supports true color, the following command should print 'TRUECOLOR'
    336 #  in orange: printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
    337 #c.TerminalInteractiveShell.true_color = False
    338 
    339 #------------------------------------------------------------------------------
    340 # HistoryAccessor(HistoryAccessorBase) configuration
    341 #------------------------------------------------------------------------------
    342 
    343 ## Access the history database without adding to it.
    344 #
    345 #  This is intended for use by standalone history tools. IPython shells use
    346 #  HistoryManager, below, which is a subclass of this.
    347 
    348 ## Options for configuring the SQLite connection
    349 #
    350 #  These options are passed as keyword args to sqlite3.connect when establishing
    351 #  database conenctions.
    352 #c.HistoryAccessor.connection_options = {}
    353 
    354 ## enable the SQLite history
    355 #
    356 #  set enabled=False to disable the SQLite history, in which case there will be
    357 #  no stored history, no SQLite connection, and no background saving thread.
    358 #  This may be necessary in some threaded environments where IPython is embedded.
    359 #c.HistoryAccessor.enabled = True
    360 
    361 ## Path to file to use for SQLite history database.
    362 #
    363 #  By default, IPython will put the history database in the IPython profile
    364 #  directory.  If you would rather share one history among profiles, you can set
    365 #  this value in each, so that they are consistent.
    366 #
    367 #  Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts.
    368 #  If you see IPython hanging, try setting this to something on a local disk,
    369 #  e.g::
    370 #
    371 #      ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite
    372 #
    373 #  you can also use the specific value `:memory:` (including the colon at both
    374 #  end but not the back ticks), to avoid creating an history file.
    375 #c.HistoryAccessor.hist_file = u''
    376 
    377 #------------------------------------------------------------------------------
    378 # HistoryManager(HistoryAccessor) configuration
    379 #------------------------------------------------------------------------------
    380 
    381 ## A class to organize all history-related functionality in one place.
    382 
    383 ## Write to database every x commands (higher values save disk access & power).
    384 #  Values of 1 or less effectively disable caching.
    385 #c.HistoryManager.db_cache_size = 0
    386 
    387 ## Should the history database include output? (default: no)
    388 #c.HistoryManager.db_log_output = False
    389 
    390 #------------------------------------------------------------------------------
    391 # ProfileDir(LoggingConfigurable) configuration
    392 #------------------------------------------------------------------------------
    393 
    394 ## An object to manage the profile directory and its resources.
    395 #
    396 #  The profile directory is used by all IPython applications, to manage
    397 #  configuration, logging and security.
    398 #
    399 #  This object knows how to find, create and manage these directories. This
    400 #  should be used by any code that wants to handle profiles.
    401 
    402 ## Set the profile location directly. This overrides the logic used by the
    403 #  `profile` option.
    404 #c.ProfileDir.location = u''
    405 
    406 #------------------------------------------------------------------------------
    407 # BaseFormatter(Configurable) configuration
    408 #------------------------------------------------------------------------------
    409 
    410 ## A base formatter class that is configurable.
    411 #
    412 #  This formatter should usually be used as the base class of all formatters. It
    413 #  is a traited :class:`Configurable` class and includes an extensible API for
    414 #  users to determine how their objects are formatted. The following logic is
    415 #  used to find a function to format an given object.
    416 #
    417 #  1. The object is introspected to see if it has a method with the name
    418 #     :attr:`print_method`. If is does, that object is passed to that method
    419 #     for formatting.
    420 #  2. If no print method is found, three internal dictionaries are consulted
    421 #     to find print method: :attr:`singleton_printers`, :attr:`type_printers`
    422 #     and :attr:`deferred_printers`.
    423 #
    424 #  Users should use these dictionaries to register functions that will be used to
    425 #  compute the format data for their objects (if those objects don't have the
    426 #  special print methods). The easiest way of using these dictionaries is through
    427 #  the :meth:`for_type` and :meth:`for_type_by_name` methods.
    428 #
    429 #  If no function/callable is found to compute the format data, ``None`` is
    430 #  returned and this format type is not used.
    431 
    432 ##
    433 #c.BaseFormatter.deferred_printers = {}
    434 
    435 ##
    436 #c.BaseFormatter.enabled = True
    437 
    438 ##
    439 #c.BaseFormatter.singleton_printers = {}
    440 
    441 ##
    442 #c.BaseFormatter.type_printers = {}
    443 
    444 #------------------------------------------------------------------------------
    445 # PlainTextFormatter(BaseFormatter) configuration
    446 #------------------------------------------------------------------------------
    447 
    448 ## The default pretty-printer.
    449 #
    450 #  This uses :mod:`IPython.lib.pretty` to compute the format data of the object.
    451 #  If the object cannot be pretty printed, :func:`repr` is used. See the
    452 #  documentation of :mod:`IPython.lib.pretty` for details on how to write pretty
    453 #  printers.  Here is a simple example::
    454 #
    455 #      def dtype_pprinter(obj, p, cycle):
    456 #          if cycle:
    457 #              return p.text('dtype(...)')
    458 #          if hasattr(obj, 'fields'):
    459 #              if obj.fields is None:
    460 #                  p.text(repr(obj))
    461 #              else:
    462 #                  p.begin_group(7, 'dtype([')
    463 #                  for i, field in enumerate(obj.descr):
    464 #                      if i > 0:
    465 #                          p.text(',')
    466 #                          p.breakable()
    467 #                      p.pretty(field)
    468 #                  p.end_group(7, '])')
    469 
    470 ##
    471 #c.PlainTextFormatter.float_precision = ''
    472 
    473 ## Truncate large collections (lists, dicts, tuples, sets) to this size.
    474 #
    475 #  Set to 0 to disable truncation.
    476 #c.PlainTextFormatter.max_seq_length = 1000
    477 
    478 ##
    479 #c.PlainTextFormatter.max_width = 79
    480 
    481 ##
    482 #c.PlainTextFormatter.newline = '\n'
    483 
    484 ##
    485 #c.PlainTextFormatter.pprint = True
    486 
    487 ##
    488 #c.PlainTextFormatter.verbose = False
    489 
    490 #------------------------------------------------------------------------------
    491 # Completer(Configurable) configuration
    492 #------------------------------------------------------------------------------
    493 
    494 ## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care
    495 #  of with Jedi.
    496 #
    497 #  This will enable completion on elements of lists, results of function calls,
    498 #  etc., but can be unsafe because the code is actually evaluated on TAB.
    499 #c.Completer.greedy = False
    500 
    501 #------------------------------------------------------------------------------
    502 # IPCompleter(Completer) configuration
    503 #------------------------------------------------------------------------------
    504 
    505 ## Extension of the completer class with IPython-specific features
    506 
    507 ## DEPRECATED as of version 5.0.
    508 #
    509 #  Instruct the completer to use __all__ for the completion
    510 #
    511 #  Specifically, when completing on ``object.<tab>``.
    512 #
    513 #  When True: only those names in obj.__all__ will be included.
    514 #
    515 #  When False [default]: the __all__ attribute is ignored
    516 #c.IPCompleter.limit_to__all__ = False
    517 
    518 ## Whether to merge completion results into a single list
    519 #
    520 #  If False, only the completion results from the first non-empty completer will
    521 #  be returned.
    522 #c.IPCompleter.merge_completions = True
    523 
    524 ## Instruct the completer to omit private method names
    525 #
    526 #  Specifically, when completing on ``object.<tab>``.
    527 #
    528 #  When 2 [default]: all names that start with '_' will be excluded.
    529 #
    530 #  When 1: all 'magic' names (``__foo__``) will be excluded.
    531 #
    532 #  When 0: nothing will be excluded.
    533 #c.IPCompleter.omit__names = 2
    534 
    535 #------------------------------------------------------------------------------
    536 # ScriptMagics(Magics) configuration
    537 #------------------------------------------------------------------------------
    538 
    539 ## Magics for talking to scripts
    540 #
    541 #  This defines a base `%%script` cell magic for running a cell with a program in
    542 #  a subprocess, and registers a few top-level magics that call %%script with
    543 #  common interpreters.
    544 
    545 ## Extra script cell magics to define
    546 #
    547 #  This generates simple wrappers of `%%script foo` as `%%foo`.
    548 #
    549 #  If you want to add script magics that aren't on your path, specify them in
    550 #  script_paths
    551 #c.ScriptMagics.script_magics = []
    552 
    553 ## Dict mapping short 'ruby' names to full paths, such as '/opt/secret/bin/ruby'
    554 #
    555 #  Only necessary for items in script_magics where the default path will not find
    556 #  the right interpreter.
    557 #c.ScriptMagics.script_paths = {}
    558 
    559 #------------------------------------------------------------------------------
    560 # StoreMagics(Magics) configuration
    561 #------------------------------------------------------------------------------
    562 
    563 ## Lightweight persistence for python variables.
    564 #
    565 #  Provides the %store magic.
    566 
    567 ## If True, any %store-d variables will be automatically restored when IPython
    568 #  starts.
    569 #c.StoreMagics.autorestore = False