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

Sort model equations alphabetically and wrap equations with more than 5 terms #6560

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

liunelson
Copy link
Member

Description

  • Users requested the model equations to be sorted alphabetically such that they are easier to review and compare with literature
  • Ditto for the observables
  • Wrapped around equations that are too long
  • SymPy does not allow me to maintain a given order of terms in a multiplication or addition (so not alphabetical term order within each equation)

Screenshot 2025-02-10 at 11 42 39 PM

@liunelson liunelson added the Enhancement Improvements to features already in the application label Feb 11, 2025
@liunelson liunelson self-assigned this Feb 11, 2025
@YohannParis
Copy link
Member

After talking with @pascaleproulx and @dgauldie, this is a nice to have feature.
But the best solution would be to have:

  • a button on the top of the equations field to allow you to sort them alphabetically.
    Do Observables be listed at the end, or even better, should the non time derived equations be listed after the one derived?
  • a button to wrap/unwrap equations within the field

@liunelson
Copy link
Member Author

Based on what David said, we could merge this PR and then consider some toggles afterwards.

I don't think a toggle is necessary since the original sort order is essentially arbitrary (as generated by the MIRA AMR-to-MMT algo) and an really long, unwrapped equation is always hard to read.

Yep, the observable expressions are listed at the bottom (sorted alphabetically amongst themselves). No wrap-around for them though since SymPy doesn't allow that easily.

@YohannParis YohannParis merged commit a248524 into main Feb 13, 2025
2 checks passed
@YohannParis YohannParis deleted the nliu/sort-model-equations branch February 13, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvements to features already in the application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants