8000 Sort Greek and Hebrew characters by oscargus · Pull Request #26145 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Sort Greek and Hebrew characters #26145

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

Closed
wants to merge 1 commit into from

Conversation

oscargus
Copy link
Member

PR summary

Closes #26142 (alternative)

PR checklist

@oscargus oscargus marked this pull request as ready for review June 18, 2023 21:00
syms = sorted(list(syms))
# Assume that lists are correctly sorted
if isinstance(syms, set):
syms = sorted(list(syms))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
syms = sorted(list(syms))
syms = sorted(syms)

sets are iterable so sorted can take them directly.

Super picky, take it or leave it.

@tacaswell tacaswell modified the milestones: v3.7.2, v3.7-doc Jun 20, 2023
\upsilon \xi \zeta \digamma \varepsilon \varkappa \varphi
\varpi \varrho \varsigma \vartheta""".split()],
r"""\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma
\nu \xi \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega \digamma

wiki says "..., Φ φ, Χ χ, Ψ ψ, ..."

https://en.wikipedia.org/wiki/Greek_alphabet

\varpi \varrho \varsigma \vartheta""".split()],
r"""\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma
\varepsilon \vartheta \varkappa \varphi \varpi \varrho \varsigma""".split()],
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to put the \var versions with their normal versions or all at the end like tihs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. :-)

["Hebrew",
6,
r"""\aleph \beth \daleth \gimel""".split()],
r"""\aleph \beth \gimel \daleth""".split()],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
r"""\aleph \beth \gimel \daleth""".split()],
r"""\daleth \gimel \beth \aleph""".split()],

I trust @story645 's suggestion that the Hebrew should be ordered right-to-left.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, missed that aspect of it.

@tacaswell
Copy link
Member

I think this is a more direct approach than #26142 . This is a script we control for building docs, if we want them ordered....just put them in order and rely on latin alphabet sorting for the symbols.

@story645
Copy link
Member
story645 commented Jun 20, 2023

.just put them in order and rely on latin alphabet sorting for the symbols.

but why when if we use the rendered characters then we can rely on those alphabets for sorting? I don't get why we're like "for English we'll sort on English, for other languages we'll manually sort"

@tacaswell
Copy link
Member

Pragmatically, it is unlikely that the Greek alphabet is going to get any additional letters and the correct sorting on the Greek and Hebrew is not equivalent to the lexigraphical sorting. Just putting them in order is the leas 8000 t work and requires no maintenance.

On the other hand, it is possible (and certainly more likely) that we may pick up additional math symbols and the math symbols have no natural sorting, so go with lexical sorting. I guess we could pre-sort them too, but then if we ever do add a new symbol to the set we would have to worry about keep them in order.

@story645
Copy link
Member
story645 commented Jun 20, 2023

Just putting them in order is the least work and requires no maintenance.

The sorting code is already written, so there's no more upfront work except a review...putting em in order - which requires verifying it's in order - only requires no maintenance if we don't touch those datasets - otherwise every time they get touched someone needs to double check that they stay in order (which needs to be documented).

Eta: I guess I'm confused/slightly frustrated cause I mostly don't think I'm doing anything fancy by using different sorting keys. Eta2: another way of putting it is having the sort be auto at the end removes the constraint of requiring that the lists be sorted. Eta3: poking at this more, what I think I'm really pushing for is a kind of localized responsibility - printing the table is why sort matters, so let the printing enforce the sort.

@oscargus
Copy link
Member Author

Closing this as #26142 has evolved.

@oscargus oscargus closed this Jun 23, 2023
@oscargus oscargus deleted the greekhebrewsort branch June 23, 2023 09:14
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.

3 participants
0