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

PR: Change default format in array editor to '' #22484

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

jitseniesen
Copy link
Member

Description of Changes

Before, the default format in the array editor for non-numeric arrays was set to 's'. This meant that ArrayModel.data() returned a value of type numpy.str_ for string arrays instead of a value of type str. The consequence was that the contents of the array were not shown.

This PR changes the default format to '' to fix this. It also adds a regression test.

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Included a screenshot or animation (if affecting the UI, see Licecap)

Issue(s) Resolved

Fixes #22466

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:
Jitse Niesen

Before, the default format in the array editor for non-numeric arrays
was set to 's'. This meant that ArrayModel.data() returned a value of
type numpy.str_ for string arrays instead of a value of type str. The
consequence was that the contents of the array were not shown. Changing
the default format to '' fixes this.

Also add a regression test.
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @jitseniesen!

@ccordoba12 ccordoba12 changed the title PR: Change default format in array editor to '' PR: Change default format in array editor to '' Sep 11, 2024
@ccordoba12 ccordoba12 merged commit 2d2e0a9 into spyder-ide:master Sep 11, 2024
14 checks passed
@ccordoba12
Copy link
Member

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/spyder that referenced this pull request Sep 11, 2024
ccordoba12 pushed a commit that referenced this pull request Sep 11, 2024
@jitseniesen jitseniesen deleted the string-array branch September 16, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ndarray of text does not display correctly in variable explorer
2 participants