bgc_data_processing.core.io.savers¶
Save Storers to a file.
StorerSaver(storer, save_aggregated_data_only=False)
¶
  Saver for Storer objects.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
storer | 
          
                Storer
           | 
          
             Storer to save.  | 
          required | 
save_aggregated_data_only | 
          
                bool
           | 
          
             Whether to only save the aggregated data or not. If False, for every provider, a folder with the providers' data will be created.  | 
          
                False
           | 
        
Source code in src/bgc_data_processing/core/io/savers.py
                65 66 67 68 69 70 71 72  |  | 
single_filename_format: str = 'nutrients_{provider}_{dates}.txt'
  
  
      class-attribute
      instance-attribute
  
¶
  
aggr_filename_format: str = 'bgc_{category}_{dates}.txt'
  
  
      class-attribute
      instance-attribute
  
¶
  
save_aggregated_data_only = save_aggregated_data_only
  
  
      instance-attribute
  
¶
  
saving_order: list[str]
  
  
      property
      writable
  
¶
  Saving Order for variables.
save_from_daterange(dateranges_gen, saving_directory)
¶
  Save the storer's data according to the given dateranges.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
dateranges_gen | 
          
                DateRangeGenerator
           | 
          
             Generator to use to retrieve dateranges.  | 
          required | 
saving_directory | 
          
                Path | str
           | 
          
             Path to the idrectory to save in.  | 
          required | 
Source code in src/bgc_data_processing/core/io/savers.py
            248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268  |  | 
save_all_storer(filepath)
¶
  Save all the storer to the given file.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
filepath | 
          
                Path | str
           | 
          
             File in which to save the storer data.  | 
          required | 
Raises:
| Type | Description | 
|---|---|
                FileExistsError
           | 
          
             If filepath points to an existing file.  | 
        
Source code in src/bgc_data_processing/core/io/savers.py
            270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286  |  | 
save(storer, filepath, save_aggregated_data_only=False)
  
  
      classmethod
  
¶
  Save all the storer to the given file.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
storer | 
          
                Storer
           | 
          
             Storer to save.  | 
          required | 
filepath | 
          
                Path | str
           | 
          
             File in which to save the storer data.  | 
          required | 
save_aggregated_data_only | 
          
                bool
           | 
          
             Whether to only save the aggregated data or not. If False, for every provider, a folder with the provider's data will be created.  | 
          
                False
           | 
        
Source code in src/bgc_data_processing/core/io/savers.py
            288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309  |  | 
save_storer(storer, filepath, saving_order=None, save_aggregated_data_only=True)
¶
  Save en entire Storer to a given filepath.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
storer | 
          
                Storer
           | 
          
             Storer to save.  | 
          required | 
filepath | 
          
                Path | str
           | 
          
             File in which to save the storer data.  | 
          required | 
saving_order | 
          
                list[str] | None
           | 
          
             Variable order to respect when saving. If the list is empty , all variables are saved., by default None  | 
          
                None
           | 
        
save_aggregated_data_only | 
          
                bool
           | 
          
             Whether to only save the aggregated data or not. If False, for every provider, a folder with the provider's data will be created., by default True  | 
          
                True
           | 
        
Source code in src/bgc_data_processing/core/io/savers.py
            17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45  |  |