From 0b76afab4064609116bf30bf767f4f69e2c58489 Mon Sep 17 00:00:00 2001 From: Denis Alevi Date: Tue, 6 Jul 2021 13:01:48 +0200 Subject: [PATCH 1/2] Fix wrong preference example in documentation [ci skip] --- docs_sphinx/advanced/preferences.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs_sphinx/advanced/preferences.rst b/docs_sphinx/advanced/preferences.rst index ea9b895b1..7ffb69c2f 100644 --- a/docs_sphinx/advanced/preferences.rst +++ b/docs_sphinx/advanced/preferences.rst @@ -3,7 +3,7 @@ Preferences Brian has a system of global preferences that affect how certain objects behave. These can be set either in scripts by using the `prefs` object -or in a file. Each preference looks like ``codegen.c.compiler``, i.e. dotted +or in a file. Each preference looks like ``codegen.cpp.compiler``, i.e. dotted names. Accessing and setting preferences @@ -11,8 +11,8 @@ Accessing and setting preferences Preferences can be accessed and set either keyword-based or attribute-based. The following are equivalent:: - prefs['codegen.c.compiler'] = 'gcc' - prefs.codegen.c.compiler = 'gcc' + prefs['codegen.cpp.compiler'] = 'gcc' + prefs.codegen.cpp.compiler = 'gcc' Using the attribute-based form can be particulary useful for interactive work, e.g. in ipython, as it offers autocompletion and documentation. From d70fa01ad2ba35b82cf03edd68ef7c53fcbc112b Mon Sep 17 00:00:00 2001 From: Marcel Stimberg Date: Wed, 7 Jul 2021 11:54:27 +0200 Subject: [PATCH 2/2] Fix two more instances of `codegen.c` and change gcc->unix [ci skip] --- docs_sphinx/advanced/preferences.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs_sphinx/advanced/preferences.rst b/docs_sphinx/advanced/preferences.rst index 7ffb69c2f..fead094f7 100644 --- a/docs_sphinx/advanced/preferences.rst +++ b/docs_sphinx/advanced/preferences.rst @@ -11,13 +11,13 @@ Accessing and setting preferences Preferences can be accessed and set either keyword-based or attribute-based. The following are equivalent:: - prefs['codegen.cpp.compiler'] = 'gcc' - prefs.codegen.cpp.compiler = 'gcc' + prefs['codegen.cpp.compiler'] = 'unix' + prefs.codegen.cpp.compiler = 'unix' Using the attribute-based form can be particulary useful for interactive work, e.g. in ipython, as it offers autocompletion and documentation. -In ipython, ``prefs.codegen.c?`` would display a docstring with all -the preferences available in the ``codegen.c`` category. +In ipython, ``prefs.codegen.cpp?`` would display a docstring with all +the preferences available in the ``codegen.cpp`` category. Preference files ----------------