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

Investigate using otoole to read in OSeMOSYS datafile #6

Open
willu47 opened this issue Sep 9, 2020 · 1 comment
Open

Investigate using otoole to read in OSeMOSYS datafile #6

willu47 opened this issue Sep 9, 2020 · 1 comment

Comments

@willu47
Copy link
Collaborator

willu47 commented Sep 9, 2020

otoole uses the Amply package to read a GNU Math Prog datafile into a Python dict of pandas DataFrames.

For example

from otoole.read_strategies import ReadDatafile

filepath = 'path/to/kenya.txt'
strategy = ReadDatafile()
osemosys_model, default_values = strategy.read(filepath)

This might be a nice way then edit the model, by adding new rows to the pandas dataframes and then writing out the model using a write strategy:

from otoole.write_strategies import WriteDatafile

filepath = 'path/to/kenya_gis.txt'
strategy = WriteDatafile()
strategy.write(filepath, osemosys_model, default_values)
@NMoksnes
Copy link
Collaborator

NMoksnes commented Sep 9, 2020

Ok. Maybe we can have a chat about this. It sounds good, and follows the current OSeMOSYS workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants