`dm.read_smi()` copies a file to an already existing location
See original GitHub issueWhen I try to load a remote .smi
file using Datamol, I run into the following exception:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
(...)
File ~/mambaforge/envs/mood/lib/python3.10/site-packages/datamol/io.py:320, in read_smi(urlpath)
318 if not fsspec.utils.can_be_local(str(urlpath)):
319 active_path = pathlib.Path(tempfile.mkstemp()[1])
--> 320 dm.utils.fs.copy_file(urlpath, active_path)
322 # Read the molecules
323 supplier = rdmolfiles.SmilesMolSupplier(str(active_path), titleLine=0)
File ~/mambaforge/envs/mood/lib/python3.10/site-packages/datamol/utils/fs.py:250, in copy_file(source, destination, chunk_size, force, progress, leave_progress)
247 raise ValueError(f"The file being copied does not exist or is not a file: {source}")
249 if not force and is_file(destination_file): # type: ignore
--> 250 raise ValueError(f"The destination file to copy already exists: {destination}")
252 with source_file as source_stream:
253 with destination_file as destination_stream:
ValueError: The destination file to copy already exists: /tmp/tmpkzrm7u58
Seems like this function is not up-to-date with recent changes in the dm.utils.fs
module? Seems to me like active_path
should be set differently to a non-existing file.
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
init/README.md
An example is the userdebug logcatd.rc and Android.mk files located in the system/core/logcat directory. The LOCAL_INIT_RC macro in the Android.mk file ...
Read more >fscrypt/README.md at master - GitHub
There are only a few cases where copying files into an encrypted directory can really make sense, such as: The source files are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes I remember hesitating doing that at the very beginning of datamol but I prefer to stick to rdkit here in case the rdkit function is modified. If a user use
read_smi
he will expect the equivalent rdkit function under the hood.Yes. There is nothing specific to .smi. It’s just a csv-like format.