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

Doing some cleanup on Littelmann paths #36987

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

tscrim
Copy link
Collaborator

@tscrim tscrim commented Jan 1, 2024

We do some cleanup on Littelmann paths by allowing greater input (including covering a surprising case when passing in a Cartan type and a weight for finite type), some PEP8 stuff, some doc formatting, commenting out assert statements, and other misc improvements. This is not necessarily meant to be comprehensive, but it moves things in the right direction. The most important thing is fixing the surprising input behavior.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • 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 accordingly.

⌛ Dependencies

@tscrim
Copy link
Collaborator Author

tscrim commented Jan 1, 2024

@bsalisbury1

@bsalisbury1
Copy link
Contributor

bsalisbury1 commented Jan 3, 2024

This is my first attempt at using the new GitHub setup with Sage (I know, I'm very slow), so I'm not sure how to officially make comments on a ticket. I'm having trouble building the documentation on my machine anyway (probably because I'm so far behind on builds -- even though 10.3.beta4 builds fine). Anyway, here are some comments:

  • Are f-strings not being used in Sage by default yet? For example, I would replace line 256 with
f"The crystal of LS paths of type {self._cartan_type} and weight {self.weight}"
  • Why are the assert lines, like line 353, being commented out rather than deleted outright?
  • For consistency, line 517: "Return the dualized path of self."
  • Delete "the" from the beginning of ValueError in line 719.

Otherwise, I think it looks good.

@tscrim
Copy link
Collaborator Author

tscrim commented Jan 6, 2024

This is my first attempt at using the new GitHub setup with Sage (I know, I'm very slow), so I'm not sure how to officially make comments on a ticket. I'm having trouble building the documentation on my machine anyway (probably because I'm so far behind on builds -- even though 10.3.beta4 builds fine).

For the docbuilds, this is now done automatically, which can be checked in the link right above your comment. So you don't have to do it yourself anymore.

* Are f-strings not being used in Sage by default yet?  For example, I would replace line 256 with

Changed; although I personally find f-strings to be a bit more annoying than the % and .format().

* Why are the `assert` lines, like line 353, being commented out rather than deleted outright?

In case we wanted to have proper checks at some point, but I removed them.

* For consistency, line 517: "Return the dualized path of `self`."

Done.

* Delete "the" from the beginning of `ValueError` in line 719.

I did not remove this as it would make the message use very weird English.

@bsalisbury1
Copy link
Contributor

This is my first attempt at using the new GitHub setup with Sage (I know, I'm very slow), so I'm not sure how to officially make comments on a ticket. I'm having trouble building the documentation on my machine anyway (probably because I'm so far behind on builds -- even though 10.3.beta4 builds fine).

For the docbuilds, this is now done automatically, which can be checked in the link right above your comment. So you don't have to do it yourself anymore.

That's a nice feature!

  • Delete "the" from the beginning of ValueError in line 719.

I did not remove this as it would make the message use very weird English.

I don't know that it's weird. In any case, the suggestion was based on the change you made on line 180.

Beyond that, the bot above is reporting Build & Test / build (pull_request) failure. It looks like there are some failed doctests. I can replicate the failures on my machine.

...
      File "sage/modules/with_basis/indexed_element.pyx", line 51, in sage.modules.with_basis.indexed_element.IndexedFreeModuleElement.__init__
        def __init__(self, M, x):
    TypeError: __init__() takes exactly 2 positional arguments (1 given)
**********************************************************************
1 item had failures:
   6 of  28 in sage.combinat.crystals.littelmann_path.CrystalOfProjectedLevelZeroLSPaths.one_dimensional_configuration_sum
    [321 tests, 6 failures, 4.60 s]
----------------------------------------------------------------------
sage -t --long --random-seed=82460175991284101813365755524236173996 src/sage/combinat/crystals/littelmann_path.py  # 6 doctests failed
----------------------------------------------------------------------

@tscrim
Copy link
Collaborator Author

tscrim commented Jan 8, 2024

  • Delete "the" from the beginning of ValueError in line 719.

I did not remove this as it would make the message use very weird English.

I don't know that it's weird. In any case, the suggestion was based on the change you made on line 180.

I ended up deleting too much on line 180. I added the "the" back in there as it is weird without it there too.

Beyond that, the bot above is reporting Build & Test / build (pull_request) failure. It looks like there are some failed doctests. I can replicate the failures on my machine.

Fixed. It was only being tested with # long time tests, which I forgot to check before pushing.

Copy link

github-actions bot commented Jan 8, 2024

Documentation preview for this PR (built with commit b068353; changes) is ready! 🎉

@bsalisbury1
Copy link
Contributor

Everything now looks good to me. I still don't see a way to give this a "positive review"...

@tscrim
Copy link
Collaborator Author

tscrim commented Jan 10, 2024

@mkoeppe Please add Ben @bsalisbury1 to the "triage" team so he can approve the PR.

@mkoeppe
Copy link
Contributor

mkoeppe commented Jan 10, 2024

When I looked, @bsalisbury1 was already on Triage, so someone seems to have been faster!

@tscrim
Copy link
Collaborator Author

tscrim commented Jan 11, 2024

Thank you, likely to @fchapoton for doing that. (Actually, I just realized I probably have sufficient powers now to do that myself...)

@bsalisbury1 If everything is still good with you, then please approve the PR (under the "files changed" and "review changes" button).

Copy link
Contributor

@bsalisbury1 bsalisbury1 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.

vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2024
sagemathgh-36987: Doing some cleanup on Littelmann paths
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

We do some cleanup on Littelmann paths by allowing greater input
(including covering a surprising case when passing in a Cartan type and
a weight for finite type), some PEP8 stuff, some doc formatting,
commenting out assert statements, and other misc improvements. This is
not necessarily meant to be comprehensive, but it moves things in the
right direction. The most important thing is fixing the surprising input
behavior.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [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 accordingly.

### ⌛ Dependencies

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

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36987
Reported by: Travis Scrimshaw
Reviewer(s): Ben Salisbury
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2024
sagemathgh-36987: Doing some cleanup on Littelmann paths
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

We do some cleanup on Littelmann paths by allowing greater input
(including covering a surprising case when passing in a Cartan type and
a weight for finite type), some PEP8 stuff, some doc formatting,
commenting out assert statements, and other misc improvements. This is
not necessarily meant to be comprehensive, but it moves things in the
right direction. The most important thing is fixing the surprising input
behavior.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [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 accordingly.

### ⌛ Dependencies

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

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36987
Reported by: Travis Scrimshaw
Reviewer(s): Ben Salisbury
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2024
sagemathgh-36987: Doing some cleanup on Littelmann paths
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

We do some cleanup on Littelmann paths by allowing greater input
(including covering a surprising case when passing in a Cartan type and
a weight for finite type), some PEP8 stuff, some doc formatting,
commenting out assert statements, and other misc improvements. This is
not necessarily meant to be comprehensive, but it moves things in the
right direction. The most important thing is fixing the surprising input
behavior.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [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 accordingly.

### ⌛ Dependencies

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

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36987
Reported by: Travis Scrimshaw
Reviewer(s): Ben Salisbury
@vbraun vbraun merged commit 127d589 into sagemath:develop Jan 22, 2024
@tscrim tscrim deleted the crystals/improve_ls_path_init branch January 22, 2024 08:10
@mkoeppe mkoeppe added this to the sage-10.3 milestone Mar 7, 2024
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.

4 participants