Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
There are no actual random tests: the ones testing the values all have fixed params, and the only random ones are testing property getter/setters and never actually runs the scheme even once.
IMHO the fact that the tests (which are not random) failed with this exact message
AttributeError: 'PokemonType' object has no attribute 'name'
in casename
was not implemented clearly mean that the thing is tested for, and this should be marked as a Suggestion, not an issue. Btw I now have added 2 more explicit test cases.Oh yeah duh, I didn't even think how dict recognizes keys in python. xD
I even used it myself to use list as keys sometimes. x)
This comment is hidden because it contains spoiler information about the solution
It is not tested that the instance attribute is really defined as
name
, only accidentally (because part of random tests explode if it isn't)ATTACK_MULTIPLIERS
so it is consistent that it contains details from an attacking POV. Flying attacks Ground with 1x damage (nothing to specify), while Ground attacks Flying with a 2x damage. This is not always the case that if Type_A does 2x dmg Type_B then Type_B does 0.5x dmg Type_A.test.expect
something) of the testing suite@test.desribe
&@test.it
decorator. I realize now you mixed this up with the assertion thing (which is also a problem, but not the same. My mistake again).test.expect
in the example tests, they will assume the invisible tests will be written that way. That doesn't encourage in thinking they'll have a good experience with the kata.Hi, this time (to answer the "...again") I don't think you nail any real point tbh.
"Normal": {"Ghost": 0}
i.e. "Normal" does 0 damage to "Ghost".test.expect
nortest.assert_equals
without error description in the internal test case. If you found some other type of misleading error description please provide me something to watch for and I'll fix ittest.expect(PT.get("Ghost").is_immune_to("Normal"))
in the sample tests where users can add/comment out/edit as they need to (if they actually experience errors) is perfectly fine, readable and clear. I also don't thinktest.assert_equals
was properly used, as per your observation, since it missed the verbose description. I've still added message description for every error (bothexpect
andassert_equals
) in the example test case, althought they make the test case code box less clean and more annoying to edit for the users imo, but whatever.DefaultType
was declared this wayDefaultType = TypeVar("DefaultType")
meaning 'DefaultType is a generic type with name "DefaultType"'. I've still changed it toDefaultType = TypeVar("T")
to be even more clear that it's just a generic type used to specify that the return type ofget
should be eitherPokemonType
or any type thedefault
param is. I think that what's on my mind is also on the initial solution, so it doesn't really need to be verbosely explained. Do you really think I should explain this inside the description?PS I still wait for your response to mark the issue as solved
Nice catch, pretty coherent the bugs were in the Bug isn't it?
Fixed, thank you. I have also double checked others and didn't find any additional error.
Hi,
Are you sure about that...?
I guessit's the same with the full test suite?test.expect
unless you provide a useful error message. Tip: just usetest.assert_equals
...DefaultType
are never explained anywhere (that's full specs. The user shouldn't have to guess what's on your mind)Cheers
This kata requires some domain knowledge, but the final equations are relatively straightforward -- not unlike the various math and music theory katas on Codewars.
The error handling, especially the careful treatment around the implosion boundary, justifies a rating around 5kyu, IMHO. I rated this as 4kyu as, per Codewars guidelines, it involves
Understanding intricate business requirements
.I'm pretty sure your Bug/Fairy multipliers are wrong. I'm doing my own implmentation of the multiplier and only failing on Bug/Fairy comparisons. Check to see if your're missing something or have incorrect values.
Also: Bug/Dark.
This comment is hidden because it contains spoiler information about the solution
I think the current approach is a reasonable tradeoff. Applying a "promised rate of return" to a monetary value always entails an accounting convention to deal with rounding, which is currently neatly encapsulated by the "black box" functions.
In theory, floats also introduce a possible loss of precision, such as
int(12345678987654321 * 1.0) == 12345678987654320
, although this would require an astronomically large Ponzi scheme to be relevant. Still, I agree with hobovsky that the truly "best practices" implementation would eschew floats altogether, e.g., by providing the rates as basis points, and assuming a downwards-rounding convention.Loading more items...