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

Added error messages in grid function for invalid values for heights and widths #4902

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

Gythre-9
Copy link
Contributor

@Gythre-9 Gythre-9 commented Mar 8, 2024

Fix #4212
The grid function (GridLayout) now throws error messages when heights and widths of the grid are not correctly set. This ensures that users receive informative feedback when specifying incorrect values, making it easier to correct issues related to grid dimensions.

I added error messages for the following conditions:

  • The sum of heights is not equal to 1.
  • The sum of widths is not equal to 1.
  • Widths values are not in the range (0, 1).
  • Heights values are not in the range (0, 1).

I have tested these changes by providing incorrect values for heights and widths, ensuring that the error messages are triggered as expected. Additionally, I have confirmed that the function continues to work correctly with valid input and with no input at all (standard values).

@BeastyBlacksmith
Copy link
Member

Don't worry the CI failures are mostly unrelated to these changes. However, please format your code with

using JuliaFormatter
format(["src", "test", "ext"], verbose=true)

@Gythre-9
Copy link
Contributor Author

Gythre-9 commented Mar 8, 2024

Ok, I have formatted the code using JuliaFormatter (or at least, I think i did). I also got rid of an extra space and an extra empty line.
Let me know if any further edits are needed!

@BeastyBlacksmith BeastyBlacksmith merged commit 2e9b16c into JuliaPlots:master Mar 11, 2024
4 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] grid function: Throw errors on bad settings
2 participants