Skip to content

Means to read-in fields from CDL as a string input #171

@sadielbartholomew

Description

@sadielbartholomew

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.

Metadata

Metadata

Labels

dataset readRelating to reading datasetsenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions