From 8af1591f331cb17181a8a71a49c6c8ee0a7341ce Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Wed, 22 Jul 2020 11:01:29 +0200 Subject: [PATCH] more docs, move fixmes --- README.md | 10 +--------- docs/configuration.md | 39 +++++++++++++++++++++++++++++++++++++++ docs/getting_started.md | 7 ++++++- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 350e00f..6749fa7 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,4 @@ Database of data recorded in the group. * Question: should we store the sampling rate and hardware info in the database? * ID card for each cell -## FIXMEs - -* repro must have foreign keys to dataset **and** subject -* Dataset finding samplerate in stimuli.dat can be improved -* Reading fi data from old-style directories -* maybe delegate this to Stimulus? -* implement alternative dataSources, somehow -* stimulus contrast is not read from nix file (e.g. filestimulus) maybe a problem with all mutables? -* Add relacs_nix_version to dataset, could be used to decide how to read stuff, in particular, we will switch to DataFrames for most features after nixio version 1.5 +**FIXMEs & stuff that needs to be done, check out the to docs folder** diff --git a/docs/configuration.md b/docs/configuration.md index b42033a..4923316 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -9,3 +9,42 @@ To log into the database you need the `host`, the `database name`, the `user` na Note, the selected user needs at least read access on the selected database (True? maybe also write?). The root of the fishbook package contains a file called *template_dj_local_conf.json*. copy this file to your project folder, i.e. the location from which you call your scripts, remove the `template_` prefix and fill in `database.host`, `database.user`, `database.password`. + +The json template looks like this: + +```json +{ + "database.host": "yourhost", + "database.user": "yourdatabaseusername", + "database.password": "yourdatabaseuserpassword", + "database.port": 3306, + "loglevel": "DEBUG", + "display.width": 14, + "display.limit": 7, + "safemode": false, + "connection.init_function": null +} +``` + +### Example + +Let's assume you are working remotely, i.e. connecting to a remote database on a server that has the name ```foo.uni-xyz.de```. The database is up and running and allows connections via port 3306 (the default). The database is called ```fish_db``` and the user credentials are name ```baz``` and password ```bar```. The configuration file will look like this: + +```json +{ + "database.host": "foo.uni-xyz.de", + "database.user": "bar", + "database.password": "baz", + "database.port": 3306, + "loglevel": "DEBUG", + "display.width": 14, + "display.limit": 7, + "safemode": false, + "connection.init_function": null +} +``` + +In case you are working with a local database the ```database.host``` entry is ```"localhost"```. +If you ommit ```database.user``` or ```database.password``` fishbook, respectively datajoint, will ask you for the user credentials every time you run your python scripts. + +**Note:** This configuration file is pure text and can be easily read by anyone. It **must not** be part of public repository. **Do not add it to your version control system!** diff --git a/docs/getting_started.md b/docs/getting_started.md index 38c63f4..4b5c6e1 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -1,4 +1,9 @@ -# Getting started +# Getting started working with fishbook + +create a project folder and place the configuration file in it (see [configuration](./configuration.md) for more info on it) ## Package contents +```python +import fishbook as fb +```