-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from seermedical/lazy-fetch-urls
Lazy fetch urls
- Loading branch information
Showing
4 changed files
with
153 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,31 @@ | ||
# seer-py | ||
Python wrapper for seer-api, with the purpose of authenticating a user, downloading filtered data, and uploading labels. | ||
Python SDK for the Seer data platform, which handles authenticating a user, downloading channel data, and uploading labels/annotations. | ||
|
||
## Install | ||
To install, simply clone or download this repository, then type `pip install .` which will install all dependencies, and the Seer python API. | ||
To install, simply clone or download this repository, then type `pip install .` which will install all the dependencies. | ||
|
||
### Epilepsy Ecosystem Data | ||
For users attempting to download data for the [Epilepsy Ecosystem](https://www.epilepsyecosystem.org/howitworks/), please download the [latest release](https://github.com/seermedical/seer-py/releases/latest) instead of cloning the repository or downloading the master branch. The file ContestDataDownloader.py in Examples will guide you through the download process. | ||
For users attempting to download data for the [Epilepsy Ecosystem](https://www.epilepsyecosystem.org/howitworks/), please download the [latest release](https://github.com/seermedical/seer-py/releases/latest) instead of cloning the repository or downloading the master branch. Then open the script `ContestDataDownloader.py` in `Examples` and it will guide you through the download process (you will need to change a few things in this script including the path to download the data to). | ||
|
||
## Requirements | ||
This library currently requires python 3, and it if you don't currently have a python 3 installation, we recommend you use the Anaconda distribution for its simplicity, support, stability and extensibility. It can be downloaded here: https://www.anaconda.com/download | ||
This library currently requires Python 3, and it if you don't currently have a Python 3 installation, we recommend you use the Anaconda distribution for its simplicity, support, stability and extensibility. It can be downloaded here: https://www.anaconda.com/download | ||
|
||
The install instructions above will install all the required dependencies, however, if you wish to install them yourself, here's what you'll need: | ||
- [`gql`](https://github.com/graphql-python/gql): a GraphQL python library is required to query the Seer platform. To install, simply run: `pip install gql` | ||
- Pandas, numpy, and matplotlib are also required. Some of these installs can be tricky, so Anaconda is recommended, however, they can be installed separately. Please see these guides for more detailed information: | ||
- https://scipy.org/install.html | ||
- https://matplotlib.org/users/installing.html | ||
- https://pandas.pydata.org/pandas-docs/stable/install.html | ||
|
||
GraphQL python library is required to query the Seer database (in addition to Anaconda). To install, simply run: | ||
`pip install gql` | ||
|
||
Pandas, numpy, and matplotlib are also required. Some of these installs can be tricky, so Anaconda is recommended, however, they can be installed separately. Please see these guides for more detailed information: | ||
https://scipy.org/install.html | ||
https://matplotlib.org/users/installing.html | ||
https://pandas.pydata.org/pandas-docs/stable/install.html | ||
|
||
To run the jupyter notebook example (optional, included in Anaconda): | ||
`pip install notebook` | ||
To run the Jupyter notebook example (optional, included in Anaconda): `pip install notebook` | ||
|
||
## Getting Started | ||
Check out the [Example](`Examples/Example.ipynb`) for a step-by-step example of how to use the SDK to access data on the Seer platform. | ||
|
||
Check out the [Example](Examples/Example.ipynb) for a step-by-step example of how to use the API | ||
To start a Jupyter notebook, run `jupyter notebook` in a command/bash window. Further instructions on Jupyter can be found here: https://github.com/jupyter/notebook | ||
|
||
To start jupyter notebooks, run `jupyter notebook` in a command/bash window. Further instructions on Jupyter can be found here: https://github.com/jupyter/notebook | ||
## Troubleshooting | ||
|
||
### Downloading hangs on Windows | ||
There is a known issue with using python's multiprocessing module on Windows with spyder. The function `getLinks` uses `multiprocessing.Pool` to run multiple downloads simultaneously, which can cause the process to run indefinitely. The workaround for this is to ensure that the current working directory is set to the directory containing your script. Running the script from a command window will also solve this problem. Alternatively, setting `threads=1` in the `getLinks` function will stop in from using `multiprocessing` altogether. | ||
|
||
## Multiprocessing module | ||
Using multiprocessing to download links in parallel can speed things up, but Windows can sometimes make this difficult. The SeerConenct.getLinks function has the 'threads' argument, which will default to 5 on linux/MacOS, and 1 on Windows. Setting 'threads' to 1 means that no new processes will be spawned, which can avoid errors on Windows. Using multiple threads in Windows is recommended for advanced users only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters