-
Notifications
You must be signed in to change notification settings - Fork 66
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
🔧 split filter_needs
func by needs type
#1276
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1276 +/- ##
==========================================
+ Coverage 86.87% 86.91% +0.03%
==========================================
Files 56 60 +4
Lines 6532 6932 +400
==========================================
+ Hits 5675 6025 +350
- Misses 857 907 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
14683a1
to
2ae76cd
Compare
2ae76cd
to
b09375f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with a comment
@measure_time("filtering") | ||
def filter_needs( | ||
def _filter_needs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to deprecate the old name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no, because this is not part of the public api (i.e. https://sphinx-needs.readthedocs.io/en/latest/api.html), and anyhow it will force people to stop using it if they were 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(in principle we should change almost every module to have an _
, but eurgh that would be annoying 😅
This makes it clearer what representation of needs we are trying to filter (see #1264).
The idea is that eventually we might be able to analyse the filter string and perform "short-circuit" filters,
for example, if it is
id == "abc"
andfilter_needs_view
, then all we actually need to perform is anO(1)
lookup of the mapping, rather than perform anO(N)
iteration over all the needs.This then begins to address #1219.