Skip to content

Commit

Permalink
Merge pull request #636 from Quansight/release-23-01-25
Browse files Browse the repository at this point in the history
  • Loading branch information
noatamir committed Jan 26, 2023
2 parents 367c894 + 18ee436 commit 71785f1
Show file tree
Hide file tree
Showing 89 changed files with 2,378 additions and 5 deletions.
81 changes: 81 additions & 0 deletions apps/labs/posts/Spyder4-variable-explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: 'Variable Explorer improvements in Spyder 4'
published: November 28, 2019
author: daniel-althviz
description: 'In this post, we will be talking about the improvements made to the Variable Explorer. These include the brand new Object Explorer for inspecting arbitrary Python variables, full support for MultiIndex dataframes with multiple dimensions, and the ability to filter and search for variables by name and type, and much more.'
category: [IDEs]
featuredImage:
src: /posts/Spyder4-variable-explorer/blog_feature_org.svg
alt: 'An illustration of a brown and a dark brown hand coming towards each other to pass a business card with the logo of Quansight Labs.'
hero:
imageSrc: /posts/Spyder4-variable-explorer/blog_hero_var2.svg
imageAlt: 'An illustration of a dark brown hand holding up a microphone, with some graphical elements highlighting the top of the microphone.'
---

[Spyder](https://www.spyder-ide.org/) 4 will be released very soon with lots of interesting new features that you'll want to check out, reflecting years of effort by the team to improve the user experience. In this post, we will be talking about the improvements made to the Variable Explorer.

These include the brand new Object Explorer for inspecting arbitrary Python variables, full support for MultiIndex dataframes with multiple dimensions, and the ability to filter and search for variables by name and type, and much more.

It is important to mention that several of the above improvements were made possible through integrating the work of two other projects. Code from [gtabview](https://github.com/TabViewer/gtabview) was used to implement the multi-dimensional Pandas indexes, while [objbrowser](https://github.com/titusjan/objbrowser) was the foundation of the new Object Explorer.


## New viewer for arbitrary Python objects


For Spyder 4 we added a long-requested feature: full support for inspecting any kind of Python object through the Variable Explorer. For many years, Spyder has been able to view and edit a small subset of Python variables: NumPy arrays, Pandas DataFrames and Series, and builtin collections (lists, dictionaries and tuples). Other objects were displayed as dictionaries of their attributes, inspecting any of which required showing a new table. This made it rather cumbersome to use this functionality, and was the reason arbitrary Python objects were hidden by default from the Variable Explorer view.

![Python Viewer](/posts/Spyder4-variable-explorer/python-viewer.png)

For the forthcoming Spyder release, we've integrated the excellent [objbrowser](https://github.com/titusjan/objbrowser) project by Pepijn Kenter ([@titusjan](https://github.com/titusjan)), which provides a tree-like view of Python objects, to offer a much simpler and more user-friendly way to inspect them.

![Python Viewer Metadata](/posts/Spyder4-variable-explorer/python-viewer-metadata.png)

As can be seen above, this viewer will also allow users to browse extra metadata about the inspected object, such as its documentation, source code and the file that holds it.
It is very important to note that this work was accomplished thanks to the generosity of Pepijn, who kindly changed the license of [objbrowser](https://github.com/titusjan/objbrowser) to allow us to integrate it with Spyder.
To expose this new functionality, we decided to set the option to hide arbitrary Python objects in the Variable Explorer to disabled by default, and introduced a new one called `Exclude callables and modules`. With this enabled by default, Spyder will now display a much larger fraction of objects that can be inspected, while still excluding most "uninteresting" variables.

![Exclude callables modules](/posts/Spyder4-variable-explorer/exclude-callables-modules.png)

Finally, we added a context-menu action to open any object using the new Object Explorer even if they already have a builtin viewer (DataFrames, arrays, etc), allowing for deeper inspection of the inner workings of these datatypes.

![View object explorer](/posts/Spyder4-variable-explorer/view-object-explorer.png)

## Multi-index support in the dataframe viewer

One of the first features we added to the Variable Explorer in Spyder 4 was MultiIndex support in its DataFrame inspector, including for multi-level and multi-dimensional indices. Spyder 3 had basic support for such, but it was very rudimentary, making inspecting such DataFrames a less than user-friendly experience.

![Multi-index support](/posts/Spyder4-variable-explorer/multi-index-support.png)

For Spyder 4, we took advantage of the work done by Scott Hansen ([@firecat53](https://github.com/firecat53)) and Yuri D'Elia ([@wavexx](https://github.com/wavexx)) in their [gtabview](https://github.com/TabViewer/gtabview) project, particularly its improved management of column and table headings, which allows the new version of Spyder to display the index shown above in a much nicer way.

![Table headings](/posts/Spyder4-variable-explorer/table-headings.png)

## Fuzzy filtering of variables

Spyder 4 also includes the ability to filter the variables shown down to only those of interest. This employs fuzzy matching between the text entered in the search field and the name and type of all available variables.
To access this functionality, click the search icon in the Variable Explorer toolbar, or press `Ctrl+F` (`Cmd-F` on macOS) when the Variable Explorer has focus.


![Filter variables](/posts/Spyder4-variable-explorer/filter-variables.png)

To remove the current filter, simply click the search icon again, or press `Esc` or `Ctrl+F` (`Cmd-F`) while the Variable Explorer is focused.

## Refresh while code is running

We added back the ability to refresh the Variable Explorer while code is running in the console. This feature was dropped in Spyder 3.2, when we removed the old and unmaintained Python console. However, this functionality will return in Spyder 4, thanks to the fantastic work done by Quentin Peter ([@impact27](https://github.com/impact27)) to completely re-architect the way Spyder talks to the Jupyter kernels that run the code in our IPython console, integrating support for [Jupyter Comms](https://jupyter-client.readthedocs.io/en/stable/messaging.html#custom-messages).

![Refresh](/posts/Spyder4-variable-explorer/refresh.png)

To trigger a refresh, simply click the reload button on the Variable Explorer toolbar, or press the shortcut `Ctrl+R` (`Cmd-R`) when it has focus.

## Full support for sets

In Spyder 3, the Variable Explorer could only show builtin Python sets as arbitrary objects, making it very difficult for users to browse and interact with them. In Spyder 4, you can now view sets just like lists, as well as perform various operations on them.

![Screenshot of Spyder Variable Explorer UI, showing a Python set displayed in a native viewer](/posts/Spyder4-variable-explorer/set-support.png)

## UI enhancements and more

Finally, beyond the headline features, we've added numerous smaller improvements to make the Variable Explorer easier and more efficient to use. These include support for custom index names, better and more efficient automatic resizing of column widths, support for displaying Pandas Indices, tooltips for truncated column headers, and more.

Spyder's Variable Explorer is what many of you consider to be one of its standout features, so we can't wait for you all to get your hands on the even better version in Spyder 4. Thanks again to Quansight, our generous community donors, and as always all of you! Spyder 4.0.0 final is planned to be released within approximately one more week, but if you'd like to test it out immediately, follow the instructions on our [GitHub](https://github.com/spyder-ide/spyder/releases) to install the pre-release version (which won't touch your existing Spyder install or settings). As always, happy Spydering!
89 changes: 89 additions & 0 deletions apps/labs/posts/a-step-towards-educating-with-spyder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: 'A step towards educating with Spyder'
published: April 11, 2021
author: juanita-gomez
description: 'As a community manager in the Spyder team, I have been looking for ways of involving more users in the community and making Spyder useful for a larger number of people. With this, a new idea came: Education. For the past months, we have been wondering with the team whether Spyder could also serve as a teaching-learning platform, especially in this era where remote instruction has become necessary.'
category: [Community, IDEs]
featuredImage:
src: /posts/a-step-towards-educating-with-spyder/blog_feature_var2.svg
alt: 'An illustration of a brown and white hand coming towards each other to pass a business card with the logo of Quansight Labs.'
hero:
imageSrc: /posts/a-step-towards-educating-with-spyder/blog_hero_var1.svg
imageAlt: 'An illustration of a brown hand holding up a microphone, with some graphical elements highlighting the top of the microphone.'
---


As a community manager in the Spyder team, I have been looking for ways of
involving more users in the community and making Spyder useful for a larger
number of people. With this, a new idea came: Education.

For the past months, we have been wondering with the team whether Spyder
could also serve as a teaching-learning platform, especially in this era
where remote instruction has become necessary. We submitted a proposal to the
Essential Open Source Software for Science (EOSS) program of the Chan
Zuckerberg Initiative, during its third cycle, with the idea of providing a
simple way inside Spyder to create and share interactive tutorials on topics
relevant to scientific research. Unfortunately, we didn’t get this funding,
but we didn’t let this great idea die.

We submitted a second proposal to the [Python Software Foundation](https://www.python.org/psf/)
from which we were awarded $4000. For me, this is the perfect opportunity for
us to take the first step towards using Spyder for education.

## What the project is about

The goal of this project is to create specialized Python online training
content that uses Spyder as the main platform to deliver it. The grant will
cover the development of three practical workshops:

1. Python for Financial Data Analysis with Spyder
2. Python for Scientific Computing and Visualization with Spyder
3. Spyder 5 Plugin Development

They will be included as part of [Spyder’s documentation](https://docs.spyder-ide.org/current/index.html)
for remote learning, but they will also be used as hands-on materials for talks and workshops.

These materials are meant for users to learn how Spyder can accelerate their
workflow when working with Python in scientific research and data analysis.
The idea is for us to provide a way in which we can help people get the most
out of Spyder by applying it in their day-to-day jobs.

The first two workshops will cover aspects such as data exploration and
visualization with Spyder’s variable explorer and plots panes, getting
documentation through Spyder’s help pane, writing good quality and efficient
code using Spyder’s code analysis and profiler, etc.

Our last workshop will demonstrate how to create a plugin for Spyder, which,
thanks to our new API in [Spyder 5](https://github.com/spyder-ide/spyder/releases/tag/v5.0.0),
released in April 2021, will allow users to easily customize and
extend Spyder’s interface with new menus, toolbars, widgets or panes in order
to adapt it to their own needs...

## Why it is important

This project will benefit the international community of Spyder users
(around 500,000, we estimate) to discover new capabilities of Spyder in order
to take advantage of all its resources. It will also provide testing
materials for potential users who will be able to adopt Spyder as a tool for
their work in Financial Data Analysis, Scientific research and Spyder plugin
development.

For the past months, our [documentation tutorials](https://youtube.com/playlist?list=PLPonohdiDqg9epClEcXoAPUiK0pN5eRoc)
have had a great impact in our community, with more than 20,000 views in our
YouTube channel. We expect these workshops to be a great input to our
documentation and help us continue building a community around Spyder.

## What is next?

This project is just the first step towards making Spyder an educational
tool. In the future, we hope that we can develop the infrastructure necessary
to support in-IDE tutorials, by improving the tools like [Jupyter Book](https://github.com/executablebooks/jupyter-book),
[sphinx-thebe](https://github.com/executablebooks/sphinx-thebe), [MyST-Parser](https://github.com/executablebooks/MyST-Parser)
which will provide better integration to write educational tutorials.

The final goal is to enable researchers, educators and experts that don’t
necessarily have a software engineering background to build scientific
programming tutorials easily and provide them as online learning materials
in Spyder. Once the infrastructure is built, we can develop several examples
to demonstrate Spyder capabilities and teach basic scientific programming
concepts applicable to a variety of fields.
Loading

2 comments on commit 71785f1

@vercel
Copy link

@vercel vercel bot commented on 71785f1 Jan 26, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 71785f1 Jan 26, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.