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

Table trial is not defined #383

Closed
ZeitgeberH opened this issue Mar 13, 2024 · 2 comments
Closed

Table trial is not defined #383

ZeitgeberH opened this issue Mar 13, 2024 · 2 comments

Comments

@ZeitgeberH
Copy link

ZeitgeberH commented Mar 13, 2024

Hi
I was trying to setup a new raspberry PI. I got the last step Create tables.
When run the command python3 -c 'from core.Experiment import *' , I got the following error:

File "~/EthoPy/core/Experiment.py", line 298, in <module> 
  class Trial(dj.Manual):

...

"datajoint.erros.DataJoint Error: The table 'lab_experiments'.'trial' is not defined".

In the database, I can see all the 5 databases has been created : lab_experiments, lab_stimuli, lab_behavior,lab_recordings, lab_mice. And within lab_experiment, table condition and session was also created. Shall i manually add this trial table.
Is possible to share an empty database schemas to facilitate database initialization

I am using Python 3.9, datajoint 0.14.1

Thanks!

@alexevag
Copy link
Contributor

Hi, 
There have been some changes, so you can clone the latest version of the code. 

I created a new database using the docker image from https://github.com/datajoint/mysql-docker and a new conda environment with Python 3.9  on Ubuntu 20.04 (There is an issue in datajoint with python 3.10 so I recommend to Python 3.9)

In order to create the databases again, delete the ones that you have already created because datajoint checks if a table exists and doesn't update or create it.

  • First step: 
    Install python packages
pip install numpy datajoint scipy h5py pygame_menu pyopengl panda3d imageio
  • Second step (check if there is any error during each line)
python3 -c 'from core.Experiment import *'
python3 -c 'from core.Stimulus import *'
python3 -c 'from core.Behavior import *'
python3 -c 'from Stimuli import *'
python3 -c 'from Behaviors import *'
python3 -c 'from Experiments import *'

After this, you will be able to run the grating_test.py which is defined in lab_experiment table Task with id 17 on your computer (left/right arrows are responses to horizontal or vertical gratings). All test configurations are using setup_conf_idx=0 which considered as "Simulation", If you want to run it on the Raspberry, you must create a new setup_conf_idx and fill in the necessary lookup tables (#setup_configuration, #setup_configuration_screen, #setup_configuration_port) according to your needs.

So you can run: 

python run.py 17 

or 

python run.py conf/grating_test.py

What Raspberry Pi board and OS you are using?

@ZeitgeberH
Copy link
Author

Hello Alex,
Thanks for helping with the issue.
My Raspberry Pi is 4B with OS Rasbian GUN/Linux 11 (bulleye) 32 bit, Kernel version 6.1.21-v8+.
I followed your instructions but still got the same error when running the first line
python3 -c 'from core.Experiment import *'

The problem is that datajoint can not create any table that uses primary keys from other table, such as lab_experiments.trial manually creating the corresponding keys would temporally solve the issue.

I tried the docker image (https://github.com/datajoint/mysql-docker ) and it works without any problem. So i think it is the mysql database version. Version (5.7.44-48; the one that i was using) has problems, whereas datajoint/mysql-docker or the generic mysql:5.7.33 works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants