Skip to content

Investigate using otoole to read in OSeMOSYS datafile #6

Description

@willu47

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions