This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add an approximate difference method to StateFilters #10825
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
7dad902
Add an approximate difference method to StateFilters
reivilibre 1fe75e6
Add tests for the approximate difference of StateFilters
reivilibre a05692c
Newsfile
reivilibre 10a7071
Try to clarify docstring for `approx_difference`
reivilibre d0e14d5
Process all the keys to return a narrower state filter
reivilibre a5fdd46
Add more test cases
reivilibre 0e0085c
STASH
reivilibre 9d50f05
Tighten up the postconditions of `approx_difference`
reivilibre ace3316
Merge remote-tracking branch 'origin/develop' into rei/sf_diff
reivilibre c72c436
More wordsmithing — thanks David
reivilibre bacd394
Revert "STASH"
reivilibre cd1de9b
Remove needless set construction
reivilibre 6bedcba
Simplify logic a bit, since this isn't operating in-place anyway
reivilibre 42617db
Attempt to clean up `approx_difference` with improved comments and names
reivilibre 0c8e930
Split out tests into own TestCase class
reivilibre b6274d6
Add extensive tests for all 4 combinations of include_others
reivilibre f6b4dc5
Merge a test
reivilibre 0d1c3d8
Split out some very simple tests
reivilibre 18714d7
Deduplicate the old tests into the systematic style tests
reivilibre 770afea
Add function to decompose a StateFilter into four parts
reivilibre e119af9
Add `StateFilter.freeze` convenience constructor
reivilibre 70f646a
Add `recompose_from_four_parts` method as inverse
reivilibre c9bb226
Use a shorter version of `decompose_into_four_parts`.
reivilibre 093f670
Use a shorter version of `recompose_from_four_parts`
reivilibre a187c24
Use a step-by-step implementation of `approx_difference` rather than …
reivilibre 4bbe3d1
Nest the ifs for clarity; no functional change
reivilibre 20bc299
Prefix decompose/recompose method names with underscores
reivilibre 27c3a7a
Use self_excludes as it's equivalent with this definition of decompose
reivilibre 54d77c9
Rename `subtrahend` to `other` to follow convention
reivilibre 538f99e
Try 'included' rather than 'admitted' to describe state filters
reivilibre bf202bc
Rename derived variables from sub(trahend) to other.
reivilibre 9169d38
Add a little bit of context as to why this is useful
reivilibre 1f3008b
Use 'returned' instead of 'resultant' as that may be clearer
reivilibre 3552bc1
Remove formal definition to focus on one way of explaining
reivilibre 4eaf980
Use `StateFilter.freeze` in tests to improve readability
reivilibre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add an 'approximate difference' method to `StateFilter`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Somewhat feels like this could be replaced with
return StateFilter(synapse.util.frozenutil.freeze(types), include_others)
? I'm not sure if that's clearer or not though.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.
that sounds useful, probably worth doing :)