kiudee / cs-ranking

Context-sensitive ranking and choice in Python with PyTorch
https://cs-ranking.readthedocs.io
Apache License 2.0
66 stars 15 forks source link

Remove trivial super delegations #151

Closed timokau closed 4 years ago

timokau commented 4 years ago

Description

Most of the delegations were truly trivial, some others needed the more specific mixins moved first in the inheritance list. This removes a lot of boilerplate code that sometimes even makes up the majority of the classes.

Motivation and Context

Some more cleanup to make future changes easier and the code more maintainable.

How Has This Been Tested?

Testsuite & pre-commit.

Does this close/impact existing issues?

No, just maybe related to #146.

Types of changes

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

Merging #151 into master will increase coverage by 5.37%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #151      +/-   ##
==========================================
+ Coverage   51.25%   56.63%   +5.37%     
==========================================
  Files         113      113              
  Lines        6848     6558     -290     
==========================================
+ Hits         3510     3714     +204     
+ Misses       3338     2844     -494     
Impacted Files Coverage Δ
csrank/choicefunction/baseline.py 34.48% <ø> (-1.01%) :arrow_down:
csrank/choicefunction/generalized_linear_model.py 85.18% <ø> (-1.03%) :arrow_down:
csrank/core/ranknet_core.py 97.72% <ø> (ø)
...et_reader/choicefunctions/choice_data_generator.py 14.03% <ø> (-2.36%) :arrow_down:
...r/discretechoice/discrete_choice_data_generator.py 18.91% <ø> (-1.60%) :arrow_down:
...der/objectranking/object_ranking_data_generator.py 23.33% <ø> (-1.67%) :arrow_down:
csrank/discretechoice/baseline.py 57.14% <ø> (+2.14%) :arrow_up:
csrank/discretechoice/generalized_nested_logit.py 88.80% <ø> (-0.52%) :arrow_down:
csrank/discretechoice/mixed_logit_model.py 86.48% <ø> (-1.02%) :arrow_down:
csrank/discretechoice/multinomial_logit_model.py 86.11% <ø> (-1.07%) :arrow_down:
... and 40 more