mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
refactor: Move PERCENT constant to top level
This commit is contained in:
parent
60f26cc067
commit
c708e8ba8e
1 changed files with 3 additions and 4 deletions
|
@ -12,6 +12,8 @@ from aider import __version__
|
||||||
from aider.dump import dump # noqa: F401
|
from aider.dump import dump # noqa: F401
|
||||||
from aider.models import model_info_manager
|
from aider.models import model_info_manager
|
||||||
|
|
||||||
|
PERCENT = 5
|
||||||
|
|
||||||
|
|
||||||
def compute_hex_threshold(percent):
|
def compute_hex_threshold(percent):
|
||||||
"""Convert percentage to 6-digit hex threshold.
|
"""Convert percentage to 6-digit hex threshold.
|
||||||
|
@ -122,7 +124,6 @@ class Analytics:
|
||||||
if not self.user_id:
|
if not self.user_id:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
PERCENT = 5
|
|
||||||
return is_uuid_in_percentage(self.user_id, PERCENT)
|
return is_uuid_in_percentage(self.user_id, PERCENT)
|
||||||
|
|
||||||
def get_data_file_path(self):
|
def get_data_file_path(self):
|
||||||
|
@ -246,6 +247,4 @@ class Analytics:
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
a = Analytics()
|
dump(compute_hex_threshold(PERCENT))
|
||||||
dump(a.user_id)
|
|
||||||
a.is_uuid_in_percentage(a.user_id, 5)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue