equinor / sunbeam

GNU General Public License v3.0
7 stars 14 forks source link

TimeVector initialization from string #79

Closed berland closed 6 years ago

berland commented 6 years ago

TimeVector should be able to load from a string containing a Schedule deck, not only a filename containing the Schedule deck.

(the use case is string manipulation in Python before passing it off to sunbeam for merging)

berland commented 6 years ago

A currenttly-API-breaking suggestion is to have TimeVector.load() only from a string containing the deck, and let the user be responsible for wrapping a filename with open() if needed.

This would be similar to yaml.load()

joakim-hove commented 6 years ago

Currently there are methods: TimeVector.load() to load from a file, and TimeVector,load_string()to load from a string. Furtheremore the TimeVector.__init__( ) method has two optional arguments base_file = ... and base_string = .. - so I would say what you request is certainly possible; but the API might change?!

berland commented 6 years ago

Ok, the functionality seems to be there. Closing.