Skip to content
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

Use single preceding underscores instead of double underscores for private methods and functions #36

Closed
riley-harper opened this issue Aug 2, 2022 · 2 comments · Fixed by #66

Comments

@riley-harper
Copy link
Contributor

riley-harper commented Aug 2, 2022

This is a style choice that we've slowly been moving to as we make other changes. Instead of something like __method(), we use _method(). __method() does some mangling of the name of the method, but _method() is mostly just a documentation indication that the method is considered private and not part of the public API.

Similarly, let's move from __function() to _function() for consistency.

@riley-harper
Copy link
Contributor Author

riley-harper commented Nov 30, 2022

Here are the functions and methods left to change:

  • __get_comp_leaf() in linking/core/comparison.py
  • __create_training_features() in linking/training/link_step_create_comparison_features.py
  • __apply_regex_substitution() in linking/core/substitutions.py
  • __apply_substitution() in linking/core/substitutions.py
  • __load_substitutions() in linking/core/substitutions.py
  • __key_count_1() in linking/core/dist_table.py
  • __key_count_2() in linking/core/dist_table.py
  • __register_udfs() in spark/session.py
  • __create_features(), called in a skipped test in tests/matching_scoring_test.py. The method itself doesn't exist anymore.

riley-harper added a commit that referenced this issue Dec 2, 2022
…s in Training's create comparison features link step
@riley-harper riley-harper changed the title Use single preceding underscores instead of double underscores for private methods Use single preceding underscores instead of double underscores for private methods and functions Dec 2, 2022
riley-harper added a commit that referenced this issue Dec 2, 2022
- Rename __apply_regex_substitution() -> _apply_regex_substitution()
- Rename __apply_substitution() -> _apply_substitution()
- Rename __load_substitutions() -> _load_substitutions()
riley-harper added a commit that referenced this issue Dec 2, 2022
- Rename __key_count_1() -> _key_count_1()
- Rename __key_count_2() -> _key_count_2()
@riley-harper
Copy link
Contributor Author

Let's ignore __create_features() in the skipped test for now. That test will need some significant refactoring anyway, so just renaming the method doesn't make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant