@@ -66,7 +66,10 @@ pub fn create_output_directory(output_dir: &Path) -> Result<()> {
6666 Ok ( ( ) )
6767}
6868
69- /// Represents a row in the assets output CSV file
69+ /// Used to represent assets in assets output CSV file and other output files.
70+ ///
71+ /// NB: It may be better to represent assets in these other files with IDs instead, see:
72+ /// https://github.com/EnergySystemsModellingLab/MUSE_2.0/issues/581
7073#[ derive( Serialize , Deserialize , Debug , PartialEq ) ]
7174struct AssetRow {
7275 milestone_year : u32 ,
@@ -77,6 +80,7 @@ struct AssetRow {
7780}
7881
7982impl AssetRow {
83+ /// Create a new [`AssetRow`]
8084 fn new ( milestone_year : u32 , asset : & Asset ) -> Self {
8185 Self {
8286 milestone_year,
@@ -117,6 +121,7 @@ struct CapacityDualsRow {
117121 value : f64 ,
118122}
119123
124+ /// Represents the commodity balance duals data in a row of the commodity balance duals CSV file
120125#[ derive( Serialize , Deserialize , Debug , PartialEq ) ]
121126struct CommodityBalanceDualsRow {
122127 milestone_year : u32 ,
@@ -126,6 +131,7 @@ struct CommodityBalanceDualsRow {
126131 value : f64 ,
127132}
128133
134+ /// Represents the fixed asset duals data in a row of the fixed asset duals CSV file
129135#[ derive( Serialize , Deserialize , Debug , PartialEq ) ]
130136struct FixedAssetDualsRow {
131137 pac : CommodityID ,
@@ -162,6 +168,7 @@ impl DebugDataWriter {
162168 } )
163169 }
164170
171+ /// Write all debug info to output files
165172 fn write_debug_info (
166173 & mut self ,
167174 milestone_year : u32 ,
@@ -177,6 +184,7 @@ impl DebugDataWriter {
177184 Ok ( ( ) )
178185 }
179186
187+ /// Write capacity duals to file
180188 fn write_capacity_duals < ' a , I > (
181189 & mut self ,
182190 milestone_year : u32 ,
@@ -200,6 +208,7 @@ impl DebugDataWriter {
200208 Ok ( ( ) )
201209 }
202210
211+ /// Write commodity balance duals to file
203212 fn write_commodity_balance_duals < ' a , I > ( & mut self , milestone_year : u32 , iter : I ) -> Result < ( ) >
204213 where
205214 I : Iterator < Item = ( & ' a CommodityID , & ' a RegionID , & ' a TimeSliceID , f64 ) > ,
@@ -218,6 +227,7 @@ impl DebugDataWriter {
218227 Ok ( ( ) )
219228 }
220229
230+ /// Write fixed asset duals to file
221231 fn write_fixed_asset_duals < ' a , I > (
222232 & mut self ,
223233 milestone_year : u32 ,
0 commit comments