-
Notifications
You must be signed in to change notification settings - Fork 284
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
Improved Aux factory error handling: better message, delivered earlier #3182
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
959419d
Tests for expected behaviour
hdyson da8dffa
Raise error if aux factory relies on a coordinate external to cube
hdyson 92617c8
Include coordinate name in error message
hdyson eb47724
Don't check whether dependencies that are "None" are in the coords.
hdyson 054059d
Review changes: check cube name in error and variable rename
hdyson a55a30d
Truncated variable for flake8
hdyson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @hdyson, I'm a bit confuse about what this test is for. Can you maybe add a comment or two to explain please? I'm probably being slow but I don't really understand what we are asserting here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see an existing test for adding a valid aux factory. Since I wanted to test for a particular error with an invalid aux factory, it felt like a good idea to include that test to confirm I wasn't breaking existing behaviour. There are tests for adding dim coords, aux coords and cell measures, I think the lack of an existing test for an aux factory may be an oversight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're quite right. I often despair at the testing (or lack of), but let's not get into that. Adding tests that should already be there is great.
I'm still not quite sure what the
assertIsNone
asserts there is none of though. That last line is slightly information dense for my delicate and easily-confused taste.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay, now I understand. I'm using
assertIsNone
as an analogue forassertDoesNotRaise
(which doesn't exist). Would a comment help, or just removing the assertion? Personally, it always makes me nervous when I see a test with no assert in it, it always makes me wonder if it's actually been finished or not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just a comment explaining the assert (as you just have to me, thanks for that) is enough.