Skip to content
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

Add filter option #659

Merged
merged 78 commits into from
Jul 11, 2024
Merged

Add filter option #659

merged 78 commits into from
Jul 11, 2024

Conversation

frakeith
Copy link
Collaborator

Code review checklist:

  • Code is generally sensical and well commented
  • Variable/function names all telegraph their purpose and contents
  • Functions/classes have useful doc strings
  • Function arguments are typed
  • Added/modified unit tests to cover changes.
  • New features have documentation added to the docs.
  • New features and backwards compatibility breaks are noted in the RELEASE.md

@frakeith frakeith linked an issue Jun 14, 2023 that may be closed by this pull request
@Paul-Ferrell Paul-Ferrell added this to the March 2024 milestone Feb 29, 2024
@hwikle-lanl hwikle-lanl self-assigned this Jun 14, 2024
@hwikle-lanl hwikle-lanl marked this pull request as draft June 14, 2024 21:11
frakeith and others added 22 commits July 9, 2024 13:15
After some work on hand-rolled parser, deemed grammar complex
enough that it warranted using a parser generator. Since Lark
is already a project dependency, opted to write Lark grammar
for filters. This commit adds an intial, rough attempt at
the grammar.
Create mostly complete grammar for filter parsing. Some issues remain,
and some questions still need to be answered. For instance:

- Durations cannot currently be specified in terms of months or years,
since the variable length of months creates ambiguities.
- Current specs (from Frank) interpret durations as the specified time
_ago_, which might create ambiguity when combined with < and >.
- Meaningful whitespace in the spec, combined with optional whitespace
elsewhere in the spec makes parsing trickier. May be better to remove
(and use , for AND.
- Need to handle invalid tokens.
This commit modifies the parse tree transformer to return an
anonymous function that takes in an arbitrary dictionary object
and returns a boolean. I don't know how to obtain a list of all
possible keys for the input dictionary, so at present, the
transformer simply tries to get the value associated with the
key (and returns None if the key is not present). Obviously,
in the code's present state, this will cause runtime errors. Future
commits will address this issue.
At present, the filtering code pulls state information from at
least three distinct objects when filtering tests or test series.
This commit creates a new object which aggregates relevant
attributes from all of these objects into a single StateAggregate
object, which presents a unified interface for accessing these
attributes. This is intended to isolate state access, which
manages the complexity of the filtering code and allows for
cleaner filtering logic.
@hwikle-lanl hwikle-lanl marked this pull request as ready for review July 9, 2024 21:34
lib/pavilion/cmd_utils.py Outdated Show resolved Hide resolved
lib/pavilion/cmd_utils.py Outdated Show resolved Hide resolved
lib/pavilion/filters.py Outdated Show resolved Hide resolved
lib/pavilion/filters/parse_time.py Outdated Show resolved Hide resolved
lib/pavilion/series/monadic_dict.py Outdated Show resolved Hide resolved
@Paul-Ferrell Paul-Ferrell merged commit 67744a8 into develop Jul 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --filter option to consolidate filtering options
4 participants