miniufo / xgrads

Parse and read ctl and associated binary file commonly used by GrADS into xarray
https://xgrads.readthedocs.io/
MIT License
70 stars 27 forks source link

the lowercase brings some problem #22

Closed finler closed 3 years ago

finler commented 3 years ago

I have some dir was uppercase,the dset in ctl file was lowercased by the core.py , so the program can't find the data file. Can that be fixed? thanks!

miniufo commented 3 years ago

Can you provide more details? I have some test cases in tests directory, some of which have upper-case paths. All these cases passed. More details (sample data file and ctl file) would help me find the bugs.

finler commented 3 years ago

哥,我发现你是中国人…… 是这样的,我发现你的程序非常好用,我稍微改了下,将 ctl = CtlDescriptor(content=content),在程序里写好了ctl信息,然后直接读数据文件,不用生成实体.ctl文件。但是读大写目录时全被转成了小写,导致数据读不到,可能是我中间出了问题吧。 请问能不能将 ctl = CtlDescriptor(content=content) ‘官方’直接接入读数据部分啊? 非常感谢!!

miniufo commented 3 years ago

哦,明白了,我都是用文件测试的,content用的不多,我改改先,应该不难。

miniufo commented 3 years ago

做了小的更新,现在可以把CtlDescriptor当作输入参数给open_CtlDataset了,比如:

from xgrads import CtlDescriptor, open_CtlDataset

ctl = CtlDescriptor(content=content)
dset = open_CtlDataset(ctl)

print(dset)

试试看?

finler commented 3 years ago

感谢^_^

miniufo commented 3 years ago

如果没问题记得点个星给我哈,然后可以close这条问题了,谢谢。