Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Reflow IDE doc #12947

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/_static/js/set_installer_tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,14 @@ function setTabs() {
uninstall_input.checked = true;
}

function setAlert() {
for (let button of document.querySelectorAll('.install-download-button')) {
button.addEventListener('click', function() {
alert = document.querySelectorAll('.install-download-alert')[0];
alert.style.display = 'block';
});
}
}

documentReady(setTabs);
documentReady(setAlert);
55 changes: 55 additions & 0 deletions doc/install/ides.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.. _ide_setup:

IDE integration (VSCode, Spyder, etc.)
Copy link
Member Author

@larsoner larsoner Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is 100% cut-paste other than updating this title from Python IDE integration to IDE integration (VSCode, Spyder, etc.) to be more discoverable (removed Python to make it more compact given the new discoverable term additions)

======================================

Most users find it convenient to write and run their code in an `Integrated
Development Environment`_ (IDE). Some popular choices for scientific
Python development are:

- `Visual Studio Code`_ (often shortened to "VS Code" or "vscode") is a
development-focused text editor that supports many programming languages in
addition to Python, includes an integrated terminal console, and has a rich
extension ecosystem. Installing
`Microsoft's Python Extension
<https://marketplace.visualstudio.com/items?itemName=ms-python.python>`__ is
enough to get most Python users up and running. VS Code is free and
open-source.

- `Spyder`_ is a free and open-source IDE developed by and for scientists who
use Python. It can be installed via a
`standalone Spyder installer <https://docs.spyder-ide.org/current/installation.html#downloading-and-installing>`__.
To avoid dependency conflicts with Spyder, you should install ``mne`` in a
separate environment, as explained in previous sections or using our dedicated
installer. Then, instruct
Spyder to use the MNE-Python interpreter by opening
Spyder and `navigating to <https://docs.spyder-ide.org/current/faq.html#using-existing-environment>`__
:samp:`Tools > Preferences > Python Interpreter > Use the following interpreter`.

- `PyCharm`_ is an IDE specifically for Python development that provides an
all-in-one solution (no extension packages needed). PyCharm comes in a
free and open-source Community edition as well as a paid Professional edition.

For these IDEs, you'll need to provide the path to the Python interpreter you want it
to use. If you're using the MNE-Python installers, on Linux and macOS opening the
**Prompt** will display several lines of information, including a line that will read
something like:

.. code-block:: output

Using Python: /some/directory/mne-python_1.7.1_0/bin/python

Altertatively (or on Windows), you can find that path by opening the Python interpreter
you want to use (e.g., the one from the MNE-Python installer, or a ``conda`` environment
that you have activated) and running::

>>> import sys
>>> print(sys.executable) # doctest:+SKIP

This should print something like
``C:\Program Files\MNE-Python\1.7.0_0\bin\python.exe`` (Windows) or
``/Users/user/Applications/MNE-Python/1.7.0_0/.mne-python/bin/python`` (macOS).

For Spyder, if the console cannot start because ``spyder-kernels`` is missing,
install the required version in the conda environment. For example, with the
environment you want to use activated, run ``conda install spyder-kernels``.
1 change: 1 addition & 0 deletions doc/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Installing MNE-Python
:hidden:

installers
ides
manual_install
advanced
check_installation
Expand Down
25 changes: 21 additions & 4 deletions doc/install/installers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Platform-specific installers
:ref-type: ref
:color: primary
:shadow:
:class: font-weight-bold mt-3
:class: font-weight-bold mt-3 install-download-button

|cloud-arrow-down| |ensp| Download for Linux

Expand All @@ -42,7 +42,7 @@ Platform-specific installers
:ref-type: ref
:color: primary
:shadow:
:class: font-weight-bold mt-3
:class: font-weight-bold mt-3 install-download-button

|cloud-arrow-down| |ensp| Download for macOS (Intel)

Expand All @@ -58,7 +58,7 @@ Platform-specific installers
:ref-type: ref
:color: primary
:shadow:
:class: font-weight-bold mt-3
:class: font-weight-bold mt-3 install-download-button

|cloud-arrow-down| |ensp| Download for macOS (Apple Silicon)

Expand All @@ -74,12 +74,29 @@ Platform-specific installers
:ref-type: ref
:color: primary
:shadow:
:class: font-weight-bold mt-3
:class: font-weight-bold mt-3 install-download-button

|cloud-arrow-down| |ensp| Download for Windows

**Supported platforms:** Windows 10 and newer

.. card::
:class-body: text-center
:class-card: install-download-alert hidden

.. We have to use a button-link here because button-ref doesn't properly nested parse the inline code
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


.. button-link:: ./ides.html
:ref-type: ref
:color: success
:shadow:
:class: font-weight-bold mt-3
:click-parent:

|code| Go to IDE Setup
larsoner marked this conversation as resolved.
Show resolved Hide resolved

Once installation completes, **set up your IDE**!

.. raw:: html

<script async="async" src="../_static/js/update_installer_version.js"></script>
Expand Down
56 changes: 0 additions & 56 deletions doc/install/manual_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,59 +93,3 @@ tips and tricks for special situations (servers, notebooks, CUDA, installing
the development version, etc). The :ref:`contributing` has additional
installation instructions for (future) contributors to MNE-Python (e.g, extra
dependencies for running our tests and building our documentation).

.. _ide_setup:

Python IDE integration
======================

Most users find it convenient to write and run their code in an `Integrated
Development Environment`_ (IDE). Some popular choices for scientific
Python development are:

- `Visual Studio Code`_ (often shortened to "VS Code" or "vscode") is a
development-focused text editor that supports many programming languages in
addition to Python, includes an integrated terminal console, and has a rich
extension ecosystem. Installing
`Microsoft's Python Extension
<https://marketplace.visualstudio.com/items?itemName=ms-python.python>`__ is
enough to get most Python users up and running. VS Code is free and
open-source.

- `Spyder`_ is a free and open-source IDE developed by and for scientists who
use Python. It can be installed via a
`standalone Spyder installer <https://docs.spyder-ide.org/current/installation.html#downloading-and-installing>`__.
To avoid dependency conflicts with Spyder, you should install ``mne`` in a
separate environment, as explained in previous sections or using our dedicated
installer. Then, instruct
Spyder to use the MNE-Python interpreter by opening
Spyder and `navigating to <https://docs.spyder-ide.org/current/faq.html#using-existing-environment>`__
:samp:`Tools > Preferences > Python Interpreter > Use the following interpreter`.

- `PyCharm`_ is an IDE specifically for Python development that provides an
all-in-one solution (no extension packages needed). PyCharm comes in a
free and open-source Community edition as well as a paid Professional edition.

For these IDEs, you'll need to provide the path to the Python interpreter you want it
to use. If you're using the MNE-Python installers, on Linux and macOS opening the
**Prompt** will display several lines of information, including a line that will read
something like:

.. code-block:: output

Using Python: /some/directory/mne-python_1.7.1_0/bin/python

Altertatively (or on Windows), you can find that path by opening the Python interpreter
you want to use (e.g., the one from the MNE-Python installer, or a ``conda`` environment
that you have activated) and running::

>>> import sys
>>> print(sys.executable) # doctest:+SKIP

This should print something like
``C:\Program Files\MNE-Python\1.7.0_0\bin\python.exe`` (Windows) or
``/Users/user/Applications/MNE-Python/1.7.0_0/.mne-python/bin/python`` (macOS).

For Spyder, if the console cannot start because ``spyder-kernels`` is missing,
install the required version in the conda environment. For example, with the
environment you want to use activated, run ``conda install spyder-kernels``.
Loading