Skip to content

Commit

Permalink
refactor: rename _view functions to filter_
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdt committed Jul 23, 2024
1 parent 88bd9d7 commit 8b3870d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/actionsheets/sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def section_info(self, section: str) -> dict:
info['parents'] = section.split(sep='.')[:-1]
return info

def filter_view(self, entries: list[str]) -> Self:
def filter(self, entries: list[str]) -> Self:
"""
Get a filtered view comprising the given entries, and all of their parents
:param entries: List of entry IDs to include in the reduced view
Expand All @@ -111,7 +111,7 @@ def filter_view(self, entries: list[str]) -> Self:

return ActionsheetView(info=self.info, data=filtered_data)

def section_view(self, section: str) -> Self:
def filter_section(self, section: str) -> Self:
"""
Get a filtered view comprising only the children of a given section
:param section: Section ID
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def test_alt_sheet():
(['create.empty', 'test.empty'], {'create', 'create.empty', 'test', 'test.empty'}),
])
def test_filter_view(entries: list[str], result: set[str]):
assert set(main_sheet.filter_view(entries=entries).data['entry'].to_list()) == result
assert set(main_sheet.filter(entries=entries).data['entry'].to_list()) == result


def test_find_snippets():
Expand Down

0 comments on commit 8b3870d

Please sign in to comment.