Skip to content

Commit

Permalink
adapt datetime_original column name in old tags.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
wsyxbcl committed Dec 9, 2024
1 parent 800f2bd commit fcdf36c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ pub fn extract_resources(
pub fn get_temporal_independence(csv_path: PathBuf, output_dir: PathBuf) -> anyhow::Result<()> {
// Temporal independence analysis

let df = match CsvReadOptions::default()
let mut df = match CsvReadOptions::default()
.with_has_header(true)
.with_ignore_errors(false)
.with_parse_options(CsvParseOptions::default().with_try_parse_dates(true))
Expand All @@ -777,6 +777,12 @@ pub fn get_temporal_independence(csv_path: PathBuf, output_dir: PathBuf) -> anyh
}
};

// Rename datetime_original to datetime, adapts to old tags.csv
let df = match df.rename("datetime_original", "datetime".into()) {
Ok(renamed_df) => renamed_df,
Err(_) => &mut df,
};

// Readlines for parameter setup
let mut rl = Editor::new()?;
rl.bind_sequence(
Expand Down

0 comments on commit fcdf36c

Please sign in to comment.