class-resolver icon indicating copy to clipboard operation
class-resolver copied to clipboard

Add kwarg checker

Open cthoyt opened this issue 3 years ago • 1 comments
trafficstars

This PR implements a pseudo-static type checker that takes a given dictionary to instantiate a given class and checks if it is correctly formatted. It raises an exception if it does not suffice.

This will be obviously useful for complex classes like PyKEEN models


DON'T MERGE WITHOUT 100% COVERAGE

finally, a proper opportunity to ensure this thing, because I basically just wrote a static type checker and i'm sure there's tons of stuff missing

cthoyt avatar Feb 15 '22 22:02 cthoyt

Codecov Report

Merging #33 (b98be1e) into main (495b8ec) will decrease coverage by 5.06%. The diff coverage is 71.56%.

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
- Coverage   95.87%   90.81%   -5.06%     
==========================================
  Files          12       13       +1     
  Lines         388      490     +102     
  Branches       62       89      +27     
==========================================
+ Hits          372      445      +73     
- Misses         12       35      +23     
- Partials        4       10       +6     
Impacted Files Coverage Δ
src/class_resolver/metaresolver.py 71.56% <71.56%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Feb 15 '22 23:02 codecov-commenter