Skip to content

Commit

Permalink
Remove obsolete comment and code
Browse files Browse the repository at this point in the history
Remove obsolete `MetricRequestResult` type and method on
`DataRequestSpec` for generating a `MetricRequestResult`
  • Loading branch information
sgreenbury committed Aug 30, 2024
1 parent c63578a commit cad9246
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/data_request_spec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// TODO: this module to be refactored following implementation of SearchParams.
// See [#67](https://github.com/Urban-Analytics-Technology-Platform/popgetter-cli/issues/67)

use itertools::Itertools;
use nonempty::nonempty;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -78,48 +75,6 @@ impl TryFrom<DataRequestSpec> for Params {
}
}

// #[derive(Debug)]
// pub struct MetricRequestResult {
// pub metrics: Vec<MetricRequest>,
// pub selected_geometry: String,
// pub years: Vec<String>,
// }
//
// impl DataRequestSpec {
// /// Generates a vector of metric requests from a `DataRequestSpec` and a catalogue.
// pub fn metric_requests(
// &self,
// catalogue: &Metadata,
// config: &Config,
// ) -> Result<MetricRequestResult> {
// // Find all the metrics which match the requested ones, expanding
// // any regex matches as we do so
// let expanded_metric_ids: Vec<MetricId> = self
// .metrics
// .iter()
// .filter_map(|metric_spec| match metric_spec {
// MetricSpec::Metric(id) => catalogue.expand_regex_metric(id).ok(),
// MetricSpec::DataProduct(_) => None,
// })
// .flatten()
// .collect::<Vec<_>>();

// let full_selection_plan =
// catalogue.generate_selection_plan(&expanded_metric_ids, &self.geometry, &self.years)?;

// info!("Running your query with \n {full_selection_plan}");

// let metric_requests =
// catalogue.get_metric_requests(full_selection_plan.explicit_metric_ids, config)?;

// Ok(MetricRequestResult {
// metrics: metric_requests,
// selected_geometry: full_selection_plan.geometry,
// years: full_selection_plan.year,
// })
// }
// }

#[derive(Serialize, Deserialize, Debug)]
pub enum MetricSpec {
MetricId(MetricId),
Expand Down

0 comments on commit cad9246

Please sign in to comment.