EnergySystemsModellingLab / MUSE_2.0

Welcome to the MUSE 2.0 repository
GNU General Public License v3.0
1 stars 0 forks source link

Read in `examples/simple/settings.toml` #56

Closed alexdewar closed 3 months ago

alexdewar commented 3 months ago

We need to be able to read the main settings file in examples/simple/settings.toml.

Currently it contains one parameter and a number of file paths. The first step is to make a struct representing this input file and then you can deserialise it using code like this: https://github.com/EnergySystemsModellingLab/MUSE_2.0/blob/main/src/muse2/settings.rs

Ashmit8583 commented 3 months ago

can you please share the file for the example code which we can refer.

Ashmit8583 commented 3 months ago

The example code is showing some error it is showing page not found

alexdewar commented 3 months ago

I've fixed the link now. Sorry about that. It was just for the settings.rs file in the repo, which you should have already

Ashmit8583 commented 3 months ago

Thank you for the response So is there any input files which the settings.rs file is taking as we have to do the same thing taking the CSV files as input by creating a struct?

On Wed, 12 Jun 2024, 1:58 pm Alex Dewar, @.***> wrote:

I've fixed the link now. Sorry about that. It was just for the settings.rs file in the repo, which you should have already

— Reply to this email directly, view it on GitHub https://github.com/EnergySystemsModellingLab/MUSE_2.0/issues/56#issuecomment-2162412957, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAWEAH5FN7ZMP3OXOEUT43TZHABBXAVCNFSM6AAAAABJENZSVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSGQYTEOJVG4 . You are receiving this because you commented.Message ID: @.***>

alexdewar commented 3 months ago

I'm not sure I understand. The settings.rs file has functions for loading the settings.toml file. The code for loading the CSV files is elsewhere.

But, yes, for both loading the CSV files and the TOML file you will need to create your own structs representing the files, as in the example code.

Ashmit8583 commented 3 months ago

Do we have to create any test cases for the following? As there is one in the example

On Wed, 12 Jun 2024, 3:18 pm Alex Dewar, @.***> wrote:

I'm not sure I understand. The settings.rs file has functions for loading the settings.toml file. The code for loading the CSV files is elsewhere.

But, yes, for both loading the CSV files and the TOML file you will need to create your own structs representing the files, as in the example code.

— Reply to this email directly, view it on GitHub https://github.com/EnergySystemsModellingLab/MUSE_2.0/issues/56#issuecomment-2162582854, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAWEAH7G7GMXRYHJ4IUNQPTZHAKPFAVCNFSM6AAAAABJENZSVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSGU4DEOBVGQ . You are receiving this because you commented.Message ID: @.***>

alexdewar commented 3 months ago

Yep, we want tests for new code

Ashmit8583 commented 3 months ago

Thanks

On Wed, 12 Jun 2024, 3:47 pm Alex Dewar, @.***> wrote:

Yep, we want tests for new code

— Reply to this email directly, view it on GitHub https://github.com/EnergySystemsModellingLab/MUSE_2.0/issues/56#issuecomment-2162641643, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAWEAH6AR47YBFQEOPA7GVLZHAN4NAVCNFSM6AAAAABJENZSVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSGY2DCNRUGM . You are receiving this because you commented.Message ID: @.***>