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

Reimplement recipe subcommand #72

Merged
merged 23 commits into from
Sep 3, 2024
Merged

Reimplement recipe subcommand #72

merged 23 commits into from
Sep 3, 2024

Conversation

sgreenbury
Copy link
Contributor

@sgreenbury sgreenbury commented Jul 26, 2024

Closes #67.

Reimplementation of recipe subcommand with the following approach:

  • Reintroduce and revise DataRequestSpec to enable use of previous recipes.
  • Revise types in metric specification to be either MetricId or MetricText combinable in search with logical OR.
  • Implement TryFrom<DataRequestSpec> for SearchParams to enable search/download with same API
  • Add fn write_output to reduce repetition
  • Add BBox to search params (also towards Additional search functionality #66)
  • Enable recipe command to use the either DataRequestSpec or SearchParams (this is an enhancement, so will open in a new issue)

src/cli.rs Outdated Show resolved Hide resolved
src/cli.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/search.rs Outdated Show resolved Hide resolved
test_recipe.json Outdated Show resolved Hide resolved
src/search.rs Outdated Show resolved Hide resolved
src/data_request_spec.rs Outdated Show resolved Hide resolved
Comment on lines +275 to +285
/// Aside from `metric_id`, each of the fields are combined with an AND operation, so searching for
/// both text and a year range will only return metrics that satisfy both parameters.
///
/// However, if a parameter has multiple values (e.g. multiple text strings), these are combined
/// with an OR operation. So searching for multiple text strings will return metrics that satisfy
/// any of the text strings.
#[derive(Clone, Debug, Deserialize, Serialize)]
///
/// `metric_id` is considered distinctly since the list of values uniquely identifies a set of
/// metrics. This list of metrics is combined with the final combined expression of the other fields
/// with an OR operation. This enables a search or recipe to contain a combination of specific
/// `metric_id`s and other fields.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the search to be either metric_id OR (<other fields> combined with AND) to enable recipes to be a combination of metric IDs and other specifications. We should explore during user testing if this is an intuitive and useful modification or not.

sgreenbury and others added 3 commits August 30, 2024 16:10
Remove obsolete `MetricRequestResult` type and method on
`DataRequestSpec` for generating a `MetricRequestResult`
@sgreenbury sgreenbury merged commit e6f1d3a into main Sep 3, 2024
2 checks passed
@sgreenbury sgreenbury deleted the 67-reimpl-recipe branch September 3, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done:
Development

Successfully merging this pull request may close these issues.

Reimplement recipe subcommand
1 participant