Git Product home page Git Product logo

bcdb's People

Contributors

njrebello avatar olsenlabmit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bcdb's Issues

Directory error on Mac (and probably Linux)

Hi all,

Cool project you have going here, and looking forward to see how it develops. Let me play my part by contributing a first issue.

OS: Mac 11.0.1

Problem:
Executing python tool.py as instructed gives following error:

Traceback (most recent call last):
File "/Users/cjg/Documents/elix/BCDB/platform/tool.py", line 20, in
chemistries = chemistry_table()
File "/Users/cjg/Documents/elix/BCDB/platform/BigSMILES_BigSmilesObj.py", line 491, in chemistry_table
chemistries = pd.read_csv("..\BigSMILES.csv")
File "/Users/cjg/miniconda3/envs/bcdb/lib/python3.9/site-packages/pandas/io/parsers.py", line 610, in read_csv
return _read(filepath_or_buffer, kwds)
File "/Users/cjg/miniconda3/envs/bcdb/lib/python3.9/site-packages/pandas/io/parsers.py", line 462, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "/Users/cjg/miniconda3/envs/bcdb/lib/python3.9/site-packages/pandas/io/parsers.py", line 819, in init
self._engine = self._make_engine(self.engine)
File "/Users/cjg/miniconda3/envs/bcdb/lib/python3.9/site-packages/pandas/io/parsers.py", line 1050, in _make_engine
return mapping[engine](self.f, **self.options) # type: ignore[call-arg]
File "/Users/cjg/miniconda3/envs/bcdb/lib/python3.9/site-packages/pandas/io/parsers.py", line 1867, in init
self._open_handles(src, kwds)
File "/Users/cjg/miniconda3/envs/bcdb/lib/python3.9/site-packages/pandas/io/parsers.py", line 1362, in _open_handles
self.handles = get_handle(
File "/Users/cjg/miniconda3/envs/bcdb/lib/python3.9/site-packages/pandas/io/common.py", line 642, in get_handle
handle = open(
FileNotFoundError: [Errno 2] No such file or directory: '..\BigSMILES.csv'

Solution:
Change

chemistries = pd.read_csv("..\BigSMILES.csv")
to the following:
chemistries = pd.read_csv(os.path.join(os.path.dirname( __file__ ), os.pardir, "BigSMILES.csv"))
You will also need to import os in the same file.

Description:
os.path.join connects the arguments passed to it using the system's directory separator ("\" in Windows, but "/" in Mac and Linux). os.path.dirname( __file__ ) gets the directory of the current file. os.pardir references the "parent directory" symbol of the OS (".." for all 3). Works for me on Mac with these changes, and should be true for Linux, too. If you didn't have a chance to test your repo on Linux, I'd recommend it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.