Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write current commodity prices to CSV file #378

Open
Tracked by #305
alexdewar opened this issue Feb 2, 2025 · 0 comments
Open
Tracked by #305

Write current commodity prices to CSV file #378

alexdewar opened this issue Feb 2, 2025 · 0 comments
Assignees

Comments

@alexdewar
Copy link
Collaborator

alexdewar commented Feb 2, 2025

We don't actually calculate commodity prices yet, but this issue could still be tackled with some dummy values for now.

There is a file output.rs where this code could potentially live. You could either implement this as a single function or you could approach it in a more OOP-y style and make a ResultsWriter object (or something), which could house the path to the output directory along with the file handles for the different CSV files (obvs you'd only need one for this issue).

I think the best way to implement this is to make a struct representing a row of the CSV file and then mark it as #[derive(Serialize)]. Then you should be able to write it using the csv package.

We will need columns for milestone year, commodity ID, time slice and price. We may also need others at some point, but these should do for now.

@github-project-automation github-project-automation bot moved this to 📋 Backlog in MUSE Feb 2, 2025
@alexdewar alexdewar changed the title Current commodity prices Write current commodity prices to file Feb 2, 2025
@alexdewar alexdewar moved this from 📋 Backlog to 🔖 Ready in MUSE Feb 2, 2025
@alexdewar alexdewar changed the title Write current commodity prices to file Write current commodity prices to CSV file Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants