-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Labels
help wantedno contributor yetno contributor yetrefactoringa technical improvement which does not add any new features or change existing features.a technical improvement which does not add any new features or change existing features.
Description
Description
Ruff warns that two of the functions for Thai lunar date are too complex.
It may possible to convert the long if/else to some values in arrays and compute according to values in the arrays.
Expected results
Simpler/shorter functions
Current results
pythainlp/util/thai_lunar_date.py:251:5: C901
calculate_f_year_f_devis too complex (113 > 40)
pythainlp/util/thai_lunar_date.py:614:5: C901
to_lunar_dateis too complex (108 > 40)
Steps to reproduce
Run ruff against the code
(currently already inside this workflow: https://github.com/PyThaiNLP/pythainlp/blob/dev/.github/workflows/lint.yml )
PyThaiNLP version
5.0.4
Python version
Any
Operating system and version
Any
More info
No response
Possible solution
No response
Files
No response
Metadata
Metadata
Assignees
Labels
help wantedno contributor yetno contributor yetrefactoringa technical improvement which does not add any new features or change existing features.a technical improvement which does not add any new features or change existing features.
Type
Projects
Status
To do