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

Fix the latex representation of crystals tableaux #38764

Merged
merged 4 commits into from
Oct 12, 2024

Conversation

kwankyu
Copy link
Collaborator

@kwankyu kwankyu commented Oct 4, 2024

Fixes #38745

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

#38339

Copy link

github-actions bot commented Oct 4, 2024

Documentation preview for this PR (built with commit 53f0371; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu kwankyu marked this pull request as ready for review October 4, 2024 11:35
Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

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

It seems somewhat complicated to reuse s as a temporary variable compared to how it is used otherwise in the code. I think you should change the variable names around to avoid this.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Oct 5, 2024

The dependency is only there for me and for reviewers on mac.

After review, I may remove it.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Oct 5, 2024

It seems somewhat complicated to reuse s as a temporary variable compared to how it is used otherwise in the code. I think you should change the variable names around to avoid this.

OK. Done.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

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

LGTM. I am not sure about “a tex box” being correct (text?). Feel free to push a quick fix if this is indeed a typo. Afterwards (or if correct), please set to a positive review.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Oct 6, 2024

It is "TeX box": https://en.wikibooks.org/wiki/LaTeX/Boxes

Thanks!

@kwankyu kwankyu changed the title Fix latex representation of crystals tableaux Fix the latex representation of crystals tableaux Oct 6, 2024
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 9, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fixes sagemath#38745

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

sagemath#38339
    
URL: sagemath#38764
Reported by: Kwankyu Lee
Reviewer(s): Travis Scrimshaw
@vbraun vbraun merged commit 2a10479 into sagemath:develop Oct 12, 2024
18 of 19 checks passed
@dcoudert
Copy link
Contributor

With 10.5.beta7 on both macOS and fedora 39

sage -t --long --warn-long 25.9 --random-seed=223186311287983376594073409832509046315 src/sage/graphs/graph_latex.py
**********************************************************************
File "src/sage/graphs/graph_latex.py", line 1569, in sage.graphs.graph_latex.GraphLatex.tkz_picture
Failed example:
    latex(B)
Expected:
    \begin{tikzpicture}
    ...
    \newsavebox{\vertex}
    \sbox{\vertex}{${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
    \raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}
    \lr{1}\\\cline{1-1}
    \end{array}$}
    }$}\Vertex[style={minimum size=1.0cm,draw=cv0,fill=cfv0,text=clv0,shape=circle},LabelOut=false,L=\usebox{\vertex},x=...,y=...]{v0}
    ...
    \end{tikzpicture}
Got:
    \begin{tikzpicture}[>=latex,line join=bevel,]
    %%
    \node (node_0) at (8.4845bp,299.68bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{1}\\\cline{1-1}\end{array}$}}$};
      \node (node_1) at (8.4845bp,227.09bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{2}\\\cline{1-1}\end{array}$}}$};
      \node (node_2) at (8.4845bp,154.49bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{0}\\\cline{1-1}\end{array}$}}$};
      \node (node_3) at (8.4845bp,81.894bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{\overline{2}}\\\cline{1-1}\end{array}$}}$};
      \node (node_4) at (8.4845bp,9.2981bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{\overline{1}}\\\cline{1-1}\end{array}$}}$};
      \draw [blue,->] (node_0) ..controls (8.4845bp,280.16bp) and (8.4845bp,261.7bp)  .. (node_1);
      \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
      \pgfsetstrokecolor{strokecol}
      \draw (16.985bp,263.38bp) node {$1$};
      \draw [red,->] (node_1) ..controls (8.4845bp,207.56bp) and (8.4845bp,189.1bp)  .. (node_2);
      \draw (16.985bp,190.79bp) node {$2$};
      \draw [red,->] (node_2) ..controls (8.4845bp,134.97bp) and (8.4845bp,116.51bp)  .. (node_3);
      \draw (16.985bp,118.19bp) node {$2$};
      \draw [blue,->] (node_3) ..controls (8.4845bp,62.37bp) and (8.4845bp,43.911bp)  .. (node_4);
      \draw (16.985bp,45.596bp) node {$1$};
    %
    \end{tikzpicture}

@kwankyu
Copy link
Collaborator Author

kwankyu commented Oct 12, 2024

You must have installed the optional package dot2tex to your systems. That changes the behavior of the graph drawing mechanism. There is nothing wrong with the doctests.

Perhaps we need doctesting mechanism that negates # optional - dot2tex...

@kwankyu kwankyu mentioned this pull request Oct 13, 2024
5 tasks
@kwankyu
Copy link
Collaborator Author

kwankyu commented Oct 13, 2024

@dcoudert your issue is "fixed" by #38810 with # optional - !dot2tex

vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 26, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

motivated by
sagemath#38764 (comment)

fixes
sagemath#38764 (comment)

example:
```sage
      sage: SloaneEncyclopedia[60843]    # optional - sloane_database
      [1, 6, 21, 107, 47176870]

      sage: SloaneEncyclopedia[60843]    # optional - !sloane_database
      Traceback (most recent call last):
      ...
      OSError: The Sloane Encyclopedia database must be installed. Use
e.g.
      'SloaneEncyclopedia.install()' to download and install it.
```
along the way, we

- define `sloane_database` feature (I wonder why it was missing)
- fix `SloaneEncyclopedia` with the code by @sheerluck: https://github.c
om/sheerluck)sagemath#34655 (comment)
1418189098
- fix the problem of `solve()` for rubiks cube of silently choosing the
gap algorithm even when an algorithm is explicitly specified.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38810
Reported by: Kwankyu Lee
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 28, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

motivated by
sagemath#38764 (comment)

fixes
sagemath#38764 (comment)

example:
```sage
      sage: SloaneEncyclopedia[60843]    # optional - sloane_database
      [1, 6, 21, 107, 47176870]

      sage: SloaneEncyclopedia[60843]    # optional - !sloane_database
      Traceback (most recent call last):
      ...
      OSError: The Sloane Encyclopedia database must be installed. Use
e.g.
      'SloaneEncyclopedia.install()' to download and install it.
```
along the way, we

- define `sloane_database` feature (I wonder why it was missing)
- fix `SloaneEncyclopedia` with the code by @sheerluck: https://github.c
om/sheerluck)sagemath#34655 (comment)
1418189098
- fix the problem of `solve()` for rubiks cube of silently choosing the
gap algorithm even when an algorithm is explicitly specified.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38810
Reported by: Kwankyu Lee
Reviewer(s):
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.

Problem with view on MacOS
4 participants