xarray-contrib/xncml

Allow creation of empty NcML document

huard opened this issue · 1 comments

huard commented

Description

The current code assumes we're reading an existing NcML, but one use case is to create an NcML from scratch, that refers to an existing netCDF file.
I suggest to modify the signature of Dataset to

def Dataset(filepath: str, location: str):

where filepath is the path to a NcML file, and location the path to a netCDF file (existing or not). If filepath does not exist, then Dataset creates an empty xml

<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2" location={location}>

</netcdf>
huard commented

Closed by #29