-
Notifications
You must be signed in to change notification settings - Fork 23
Description
We agreed it would be useful to support a way to read-in field constructs from CDL supplied as a string, rather than defined in a file, the latter of which is the only means currently supported. (Naturally CDL is the only format we support that can be provided as a string.)
This could be handy if, say, a user had CDL copied to clipboard and they wanted to work with it interactively with cf, since they could just paste it into a string in their (i)Python session without having to save it to a file outside of the session.
An intuitive way to enable this would be a keyword argument such as cdl_string
to cf.read
to indicate, when True
, that the input argument is a str
of valid CDL rather than the path to a file, as standard, i.e:
cf.read(string, cdl_string=True)
where the default would of course be False
.