@@ -236,9 +236,10 @@ impl DataWriter {
236236 /// # Arguments
237237 ///
238238 /// * `output_path` - Folder where files will be saved
239+ /// * `model_path` - Path to input model
239240 /// * `save_debug_info` - Whether to include extra CSV files for debugging model
240- pub fn create ( output_path : & Path , save_debug_info : bool ) -> Result < Self > {
241- write_metadata ( output_path) . context ( "Failed to save metadata" ) ?;
241+ pub fn create ( output_path : & Path , model_path : & Path , save_debug_info : bool ) -> Result < Self > {
242+ write_metadata ( output_path, model_path ) . context ( "Failed to save metadata" ) ?;
242243
243244 let new_writer = |file_name| {
244245 let file_path = output_path. join ( file_name) ;
@@ -345,7 +346,7 @@ mod tests {
345346
346347 // Write an asset
347348 {
348- let mut writer = DataWriter :: create ( dir. path ( ) , false ) . unwrap ( ) ;
349+ let mut writer = DataWriter :: create ( dir. path ( ) , dir . path ( ) , false ) . unwrap ( ) ;
349350 writer. write_assets ( milestone_year, assets. iter ( ) ) . unwrap ( ) ;
350351 writer. flush ( ) . unwrap ( ) ;
351352 }
@@ -372,7 +373,7 @@ mod tests {
372373 // Write a flow
373374 let dir = tempdir ( ) . unwrap ( ) ;
374375 {
375- let mut writer = DataWriter :: create ( dir. path ( ) , false ) . unwrap ( ) ;
376+ let mut writer = DataWriter :: create ( dir. path ( ) , dir . path ( ) , false ) . unwrap ( ) ;
376377 writer. write_flows ( milestone_year, & flow_map) . unwrap ( ) ;
377378 writer. flush ( ) . unwrap ( ) ;
378379 }
@@ -403,7 +404,7 @@ mod tests {
403404
404405 // Write a price
405406 {
406- let mut writer = DataWriter :: create ( dir. path ( ) , false ) . unwrap ( ) ;
407+ let mut writer = DataWriter :: create ( dir. path ( ) , dir . path ( ) , false ) . unwrap ( ) ;
407408 writer. write_prices ( milestone_year, & prices) . unwrap ( ) ;
408409 writer. flush ( ) . unwrap ( ) ;
409410 }
0 commit comments