Beta
Approximating a higher-order differential equation using Euler's method
Loading description...
Mathematics
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
It is not specified what "invalid values" mean in the kata. Input validation without specification is an open-ended question, which boils down to everyone trying to read kata author's mind (which is bad, obviously).
If you reread the descriptions of the different arguments to the function you should find that some include descriptions of what values are considered valid. This implies what most of the invalid cases are, and the rest are covered by the other part of that paragraph, about the function not being defined.
I'll tweak the wording to try to communicate it more clearly but the relevant error cases are given from the information in the description.
Well, it's made confusing because there is another related problem with the error checking tests: they don't fail when no exceptions are thrown. They only fail the test if an exception that's not
ValueError
is thrown.Hello! I think there are some changes that can be done:
fun
parameter, specifying the return type and semantics of theeuler_sol
function is a good addition.Cheers :)
Edit: using Python's type hints is also a very good addition to make your kata much more understandable and less prone to interpretation errors.
Thanks for the comment, I've gone in and implemented the changes you suggested. Can you check to see if it's better now?
Also, do you think the default error is too strict here?
Okay, now the description is a little bit more clear. I would also suggest to use type hints here:
Also, getting to know both markdown and html is very important in order to make understandable descriptions, so maybe ussing a bullet list in the parameters descriptions would increase readability and things like that.
Are you sure about adding the type hints to the description? I don't see it adding much, and the type hints are pretty long and messy.
But yeah, I can add bullets if you want
You are not wrong, it depends on how you structure the description. I just thought those might be some good ways to use them (I always include hints), but you can do as you like.