Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

feat: extracting valid literals from documentation #78

Merged
merged 24 commits into from
Apr 3, 2023

Conversation

nvollroth
Copy link
Contributor

@nvollroth nvollroth commented Mar 31, 2023

Closes #46.

Summary of Changes

Currently, valid values for the enum annotations were determined only via the type string. In order to achieve a higher recognition rate of the enum annotations, the recognition of the valid values was extended to the description.

Testing Instructions

  1. Run pytest for test_extract_valid_literals.py.
  2. Check the results of pytest.

nvollroth and others added 5 commits March 29, 2023 14:18
…on string and the type string of a parameter
The pattern execution configuration was added.
…test_extract_valid_literals.py'

Refactored the configurations in '_extract_valid_values.py'
 dicts -> dataclasses

Deleted 'parameter_data_with_dscription.json'
@nvollroth nvollroth linked an issue Mar 31, 2023 that may be closed by this pull request
@nvollroth nvollroth requested a review from a team as a code owner March 31, 2023 12:01
@nvollroth nvollroth changed the title 46 multi part enumtype extraction feat: 46 multi part enumtype extraction Mar 31, 2023
@lars-reimann
Copy link
Member

lars-reimann commented Mar 31, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 2 0 0 0.64s
✅ PYTHON mypy 2 0 2.17s
✅ PYTHON ruff 2 0 0 0.05s
✅ REPOSITORY git_diff yes no 0.04s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Merging #78 (3c9ece5) into main (9d61efa) will increase coverage by 0.19%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   89.76%   89.96%   +0.19%     
==========================================
  Files          83       84       +1     
  Lines        3998     4075      +77     
==========================================
+ Hits         3589     3666      +77     
  Misses        409      409              
Impacted Files Coverage Δ
...y_analyzer/processing/api/_extract_valid_values.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@lukarade lukarade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it would be beneficial if the code contained more comments, it seems to do what it is supposed to.

Copy link
Contributor

@lukarade lukarade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing

nvollroth and others added 7 commits March 31, 2023 16:20
New recognition pattern for the description string was added

Detection of legal values is now interrupted only if the detection within the type string resulted in a hit.
…e as valid values when a boolean is detected.

In addition, the system checks whether there are matching string values in the description that are not True, False or None if 'str' is set in the type string. If this is not the case, 'unlistable_str' is returned.

The test cases have been adapted accordingly.
@lars-reimann lars-reimann changed the title feat: 46 multi part enumtype extraction feat: extracting valid literals from documentation Apr 3, 2023
Copy link
Member

@lars-reimann lars-reimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks excellent, thanks!

@lars-reimann
Copy link
Member

Feel free to merge this if you're done.

@nvollroth nvollroth merged commit 2c41af2 into main Apr 3, 2023
@nvollroth nvollroth deleted the 46-multi-part-enumtype-extraction branch April 3, 2023 13:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-part EnumType extraction
4 participants