Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot read the topology #33

Closed
xiki-tempula opened this issue Apr 12, 2023 · 3 comments
Closed

[BUG] Cannot read the topology #33

xiki-tempula opened this issue Apr 12, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@xiki-tempula
Copy link
Contributor

Describe the bug
Cannot read the topology

To Reproduce

import BioSimSpace as BSS
BSS.IO.readMolecules(('Mcl1_vacuum.parm7', 'Mcl1_vacuum.rst7'))

Got

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/ubuntu/miniconda3/envs/BSSOrion/lib/python3.8/site-packages/BioSimSpace/IO/_io.py:453 in   │
│ readMolecules                                                                                    │
│                                                                                                  │
│    450 │                                                                                         │
│    451 │   # Try to read the files and return a molecular system.                                │
│    452 │   try:                                                                                  │
│ ❱  453 │   │   system = _patch_sire_load(                                                        │
│    454 │   │   │   files,                                                                        │
│    455 │   │   │   directory=str(download_dir),                                                  │
│    456 │   │   │   property_map=property_map,                                                    │
│                                                                                                  │
│ /home/ubuntu/miniconda3/envs/BSSOrion/lib/python3.8/site-packages/BioSimSpace/IO/_io.py:1078 in  │
│ _patch_sire_load                                                                                 │
│                                                                                                  │
│   1075 │                                                                                         │
│   1076 │   for i in range(0, len(paths)):                                                        │
│   1077 │   │   # resolve the paths, downloading as needed                                        │
│ ❱ 1078 │   │   p += _sire._load._resolve_path(paths[i], directory=directory, silent=silent)      │
│   1079 │                                                                                         │
│   1080 │   paths = p                                                                             │
│   1081                                                                                           │
│                                                                                                  │
│ /home/ubuntu/miniconda3/envs/BSSOrion/lib/python3.8/site-packages/sire/_load.py:116 in           │
│ _resolve_path                                                                                    │
│                                                                                                  │
│   113 │   if hasattr(directory, "strpath"):                                                      │
│   114 │   │   directory = directory.strpath                                                      │
│   115 │                                                                                          │
│ ❱ 116 │   if os.path.exists(path) and os.path.isfile(path):                                      │
│   117 │   │   if path.endswith(".gz"):                                                           │
│   118 │   │   │   # unzip the file first                                                         │
│   119 │   │   │   unzipped = path[0:-3]                                                          │
│                                                                                                  │
│ /home/ubuntu/miniconda3/envs/BSSOrion/lib/python3.8/genericpath.py:19 in exists                  │
│                                                                                                  │
│    16 def exists(path):                                                                          │
│    17 │   """Test whether a path exists.  Returns False for broken symbolic links"""             │
│    18 │   try:                                                                                   │
│ ❱  19 │   │   os.stat(path)                                                                      │
│    20 │   except (OSError, ValueError):                                                          │
│    21 │   │   return False                                                                       │
│    22 │   return True                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: stat: path should be string, bytes, os.PathLike or integer, not tuple

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <module>:1                                                                                    │
│                                                                                                  │
│ /home/ubuntu/miniconda3/envs/BSSOrion/lib/python3.8/site-packages/BioSimSpace/IO/_io.py:504 in   │
│ readMolecules                                                                                    │
│                                                                                                  │
│    501 │   │   │   │   else:                                                                     │
│    502 │   │   │   │   │   raise IOError(msg) from None                                          │
│    503 │   │   │   else:                                                                         │
│ ❱  504 │   │   │   │   msg = "Failed to read molecules from: %s" % files                         │
│    505 │   │   │   │   if _isVerbose():                                                          │
│    506 │   │   │   │   │   raise IOError(msg) from e0                                            │
│    507 │   │   │   │   else:                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: not all arguments converted during string formatting

Expected behavior
Loads

Input files

Archive.zip

(please complete the following information):

  • OS: Linux
  • Version of Python: 3.8
  • Version of BioSimSpace: main
  • I confirm that I have checked this bug still exists in the latest released version of BioSimSpace: [yes/no]

Additional context
Add any other context about the problem here.

@xiki-tempula xiki-tempula added the bug Something isn't working label Apr 12, 2023
@lohedges
Copy link
Contributor

Pass the files as a list, not a tuple. I can add something to convert it behind the scenes.

@xiki-tempula
Copy link
Contributor Author

Weird, I only got this problem after I did the sync, maybe some other part failed upstream. I will have another check.

@xiki-tempula
Copy link
Contributor Author

Ok, it is not even reproducible weird.

@xiki-tempula xiki-tempula closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
lohedges pushed a commit that referenced this issue Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants