Closed brainandforce closed 1 week ago
I still get caught trying to give a plain path to the Cif
constructor and expecting it to open a file, and I wrote the thing! So perhaps the API should not interpret a string as a CIF file, but as a path.
Anyway, I like the suggestion to have an IO stream as an argument. Originally it was difficult to do this because the C cif_api
library wanted to have a path string passed to it, and I couldn't get it to work with an already-open file handle. Now that there is a Julia native parser for Cifs, a method of the form Cif(io::IO)
could be defined, so you could write Cif(open("my_cif_file.cif"))
. Is that what you were thinking of? If so, I (or you!) could add it pretty easily.
Yup, that's exactly what I was thinking. I'm not sure when I can get to this, but if I do I'll send in a PR.
Version 0.7.0 (just released) reverts to interpreting a string passed to the Cif
constructor as a file path.
The latest commit (3fcfa27) now includes a CIF constructor with an IO
first argument. Sorry for the delay.
It appears that the only methods for reading in CIF file are
Although it's not what I expected on my first attempt to use the package, I understand why a string argument is parsed as CIF contents instead of a file path - Julia really does need a dedicated path type. However, I would expect giving
Cif()
a file handle to work properly, so something along the lines ofcould work.