You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #512, the metric module has seen some major changes, one of them being the introduction of a BaseMetric class. As the name suggests, this class serves as a base class for all other metric classes in the module. It also groups together all relevant utility functions from utils. This has been done to provide users the freedom to use the individual functions as either utility functions or as part of their own metric classes, that inherit BaseMetric, without any additional import. Since the definition of these functions are fixed, as in changing even a portion of those functions would completely change their behaviour and this is not something, that we expect a user to do; in #512, they were defined as staticmethods. However, this has resulted into an intermixing between pure object oriented code and code, that is closer to functional programming. We want to avoid this, by making the module purely object oriented.
🎯 Goal
To clarify the code choices that went into the BaseMetric class and to move towards purely object-oriented code, as is the case with the rest of the library.
💡 Possible solutions
One possible solution, as suggested by @shreyasbapat, is to remove all @staticmethod decorators and turn all such functions into proper methods. Changes would be required across the metric module, in all metric classes, and in the related tests.
📋 Steps to solve the problem
Discuss the possible solutions here or in our chat room.
Comment below about what you've started working on.
Add, commit, push your changes
Submit a pull request.
Add this in the comments:
Addresses #<put issue number here> if you are partially fixing the issue.
Fixes #<put issue number here> if you are completely fixing the issue.
Ask for a review in comments section of pull request
Celebrate your contribution to this project 🎉
The text was updated successfully, but these errors were encountered:
🐞 Problem
After #512, the
metric
module has seen some major changes, one of them being the introduction of aBaseMetric
class. As the name suggests, this class serves as a base class for all other metric classes in the module. It also groups together all relevant utility functions fromutils
. This has been done to provide users the freedom to use the individual functions as either utility functions or as part of their own metric classes, that inheritBaseMetric
, without any additional import. Since the definition of these functions are fixed, as in changing even a portion of those functions would completely change their behaviour and this is not something, that we expect a user to do; in #512, they were defined asstaticmethods
. However, this has resulted into an intermixing between pure object oriented code and code, that is closer to functional programming. We want to avoid this, by making the module purely object oriented.🎯 Goal
To clarify the code choices that went into the
BaseMetric
class and to move towards purely object-oriented code, as is the case with the rest of the library.💡 Possible solutions
One possible solution, as suggested by @shreyasbapat, is to remove all
@staticmethod
decorators and turn all such functions into proper methods. Changes would be required across themetric
module, in all metric classes, and in the related tests.📋 Steps to solve the problem
Addresses #<put issue number here>
if you are partially fixing the issue.Fixes #<put issue number here>
if you are completely fixing the issue.The text was updated successfully, but these errors were encountered: