Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add missing operators code #26024

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

Merged
merged 4 commits into from
Jun 9, 2023
Merged

Add missing operators code #26024

merged 4 commits into from
Jun 9, 2023

Conversation

devRD
Copy link
Contributor

@devRD devRD commented Jun 1, 2023

PR summary

Closes #26015

Checking the LaTeX names for the corresponding Unicode values:
U+221F is defined as rightangle but there already exists a rightangle mapping which on checking is defined as rangle in the LaTeX symbols docs.

U+221B and U+221C are cube root and fourth root symbols which are presently not included in this list.

PR checklist

Copy link
Member

@oscargus oscargus 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! Is it in draft mode as some of these should also have proper spacing (#25933)?

@oscargus oscargus mentioned this pull request Jun 1, 2023
@devRD devRD marked this pull request as ready for review June 1, 2023 13:33
@devRD
Copy link
Contributor Author

devRD commented Jun 1, 2023

I think the spacing is alright unless I missed something?

@oscargus
Copy link
Member

oscargus commented Jun 1, 2023

I think that some of these operators should/could also go into the list that you modified in #25933.

'leftangle' : 10216,
'rightangle' : 10217,
'langle' : 10216,
'rangle' : 10217,
Copy link
Member

Choose a reason for hiding this comment

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

This seems to collide with

'langle' : 0x27e8,
'rangle' : 0x27e9,
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the rangle and langle I verified that both entries are the same, should I keep the decimal or the hex version?
(According to #26029, the whole list requires an overhaul for the formatting.)

Copy link
Member

Choose a reason for hiding this comment

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

I think the hex is easier to read, but I am indifferent, my concern is just that we do not have two identical entries (very far from each other) in the file.

@tacaswell
Copy link
Member

Can we at least smoke test that these work?

@oscargus
Copy link
Member

oscargus commented Jun 1, 2023

Can we at least smoke test that these work?

Not sure what you mean here? We cannot really have tests for all symbols? The best thing is probably to check the doc build to see that they look OK?

An option is of course to automatically generate an image of all defined symbols, but that would then require updating when new symbols are added.

@tacaswell tacaswell added this to the v3.8.0 milestone Jun 1, 2023
@tacaswell
Copy link
Member

Can we at least smoke test that these work?

I may be a bit confused, but each of these can be accessed via \XYZ? I am not super familiar with this code so maybe I am more worried about this working than I should be.

@oscargus
Copy link
Member

oscargus commented Jun 2, 2023

Yes, these are all accessible through \XYZ. I am quite sure that some of the entries are tested, so the basic mechanism should be tested, just not that we test each and every dict-entry.

@tfpf
Copy link
Contributor

tfpf commented Jun 3, 2023

An option is of course to automatically generate an image of all defined symbols, but that would then require updating when new symbols are added.

Instead of generating new images, is it feasible to obtain the Mathtext output and check whether the Hlist object containing the relational operator has Kern objects around it?

@devRD devRD changed the title Add missing operators hex Add missing operators code Jun 5, 2023
devRD added a commit to devRD/matplotlib that referenced this pull request Jun 5, 2023
@devRD devRD mentioned this pull request Jun 5, 2023
5 tasks
@devRD
Copy link
Contributor Author

devRD commented Jun 6, 2023

To check the changes are not throwing an error, I've included a test for the newly added mathtext operators. Should I include all operators for check or is this sufficient for testing?

@tacaswell tacaswell merged commit 7ad3bc2 into matplotlib:main Jun 9, 2023
@oscargus oscargus mentioned this pull request Jun 10, 2023
5 tasks
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.

[ENH]: Missing mathematical operations
5 participants