-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/mypy-types-cleanlab-internal-utils #608
base: master
Are you sure you want to change the base?
feature/mypy-types-cleanlab-internal-utils #608
Conversation
Adding the types for variables within the functions. type cheatsheet: 1. np array of float type: npt.NDArray["np.floating[T]"] 2. np array of int type: npt.NDArray[np.int_] 3. np array of bool type: npt.NDArray[np.bool_] 4. np.array of either bool or int: npt.NDArray[Union[np.bool_, np.int_]]
functions added for: 1. remove_noise_from_class 2. clip_noise_rates 3. clip_values 4. value_counts
functions added for: 1. remove_noise_from_class 2. clip_noise_rates 3. clip_values 4. value_counts
…m:unna97/cleanlab into feature/mypy-types-cleanlab-internal-util
Codecov Report
@@ Coverage Diff @@
## master #608 +/- ##
=======================================
Coverage 96.23% 96.23%
=======================================
Files 60 60
Lines 4705 4707 +2
Branches 817 817
=======================================
+ Hits 4528 4530 +2
Misses 91 91
Partials 86 86
|
Thanks for the PR! The internal utils module is quite large, so how about we work on those in smaller segments (say 5-10 functions/methods)? I think we can just focus on the functions you've annotated up to this point:
|
In Note that the It's outside of our control, so we should ignore the specific warning associated with that function call. - x = np.copy(noise_matrix)
+ x: npt.NDArray["np.floating[T]"] = np.copy(noise_matrix) # type: ignore[no-untyped-call] We assume that the copied variable should have the same type as the input ( |
Sure @elisno, do you mean with a separate PR for the above functions? |
You should use this PR for those functions. |
Yes, for bigger files I am using one PR. while for other segments as you have mentioned before. |
- value_counts_fill_missing_classes - get_missing_classes - round_preserving_sum - estimate_pu_f1 - confusion_matrix - print_square_matrix - print_noise_matrix - print_inverse_noise_matrix - print_joint_matrix - compress_int_array - subset_X_y - subset_labels - num_unique_classes - get_unique_classes - format_labels - smart_display_dataframe
@elisno sorry for doing so much in a single commit. I did add type hints for functions other than those you mentioned. There are specific errors in outputs that I am unsure about. |
@elisno Did you have a chance to review this? |
@elisno I was waiting for suggestions before making any further changes. Will you still be reviewing this branch? |
No description provided.