Comments (13)
for context: #15
blocked by 'who decides the end in a general case in a multi backend experiment with different playlists'? the longest union of playlists when all were stopped? ultimately there was not enough state to know that there was no possibility for an externa API call to not continue playing by switching to another item, so I elected to allow such logic to be in the python code if one does an Experment.py
experiment, or in the yaml explicitly based on time - because if done explicitly in the yaml which will contain all stims for all backends the writer of the yaml at that time has the best and most correct definition of when the total experiment is finished
from fly-vr.
Ah!! @nzjrs thanks so much for bringing this to my attention. I was able to get this to work in the time/do stanza, but I have not figured out how to implement this in the experiment.py file. Following your example in flyvr design I tried to write something that shows a stimulus a few times (randomly picking) and then stops the experiment but Max and I couldn't figure out how to get the experiment to stop...
exp_a_stop.txt
(sorry for the .txt file, it won't let me drag a .py in)
I tried these in line 40
Experiment._shared_state.signal_stop().join(timeout=5) // AttributeError: type object 'Experiment' has no attribute '_shared_state'
Experiment.stop() // just doesn't stop
self.stop() // also doesn't work - sorry I forgot to write down the error message for this
from fly-vr.
Ah!! @nzjrs thanks so much for bringing this to my attention. I was able to get this to work in the time/do stanza, but I have not figured out how to implement this in the experiment.py file. Following your example in flyvr design I tried to write something that shows a stimulus a few times (randomly picking) and then stops the experiment but Max and I couldn't figure out how to get the experiment to stop... exp_a_stop.txt
(sorry for the .txt file, it won't let me drag a .py in) I tried these in line 40 Experiment._shared_state.signal_stop().join(timeout=5) // AttributeError: type object 'Experiment' has no attribute '_shared_state' Experiment.stop() // just doesn't stop self.stop() // also doesn't work - sorry I forgot to write down the error message for this
ok, this seems like a bug where the Experiment
object does not have _shared_state
set. Are you launching this the normal flyvr.exe
way, or are you launching the experiment process manually?
If launching manually, this line should be called
fly-vr/flyvr/fictrac/fictrac_driver.py
Line 122 in 9c3bca1
which means that Experiment.stop()
should not crash.
from fly-vr.
hmmm I was launching the normal way. Here's the command from Cmder:
flyvr -c config_avd_items.yml -e exp_a_stop.py --fictrac_version 2
from fly-vr.
ok, can you check the log to see if it prints this message
fly-vr/flyvr/fictrac/fictrac_driver.py
Line 111 in 9c3bca1
from fly-vr.
are you referring to this type of log?
no, I don't see any mention of "experiment"
from fly-vr.
from fly-vr.
which line should I test with (in the .py file), is it this one:
Experiment.stop()
?
not
Experiment._shared_state.signal_stop().join(timeout=5)
?
will report back in a few...
from fly-vr.
which line should I test with (in the .py file), is it this one: Experiment.stop() ?
not Experiment._shared_state.signal_stop().join(timeout=5) ?
will report back in a few...
self.stop()
but if there isn't a log of the experiment being initialized then there is a bug somewhere else
from fly-vr.
oof. I did a bunch of testing and it is unclear to me what the pattern/problem/output is.
with the .py file I wrote above (where I try to play some audio, and after some number of times playing, I want to stop the experiment), with Experiment.stop() the initialization line shows up in the console:
flyvr.fictrac.FicTracDriver : INFO initialized experiment <exp_a_stop._MyExperiment object at 0x000001B37F05C488>
and also this error:
Process Process-3:
Traceback (most recent call last):
File "C:\Users\murthylab\miniconda3\envs\flyvr\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\murthylab\miniconda3\envs\flyvr\lib\multiprocessing\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "c:\fly-vr\flyvr\fictrac\fictrac_driver.py", line 189, in run
self.experiment.process_state(data_copy)
File "exp_a_stop.py", line 40, in process_state
Experiment.stop()
TypeError: stop() missing 1 required positional argument: 'self'
with self.stop(), SOMETIMES experiment is there
flyvr.fictrac.FicTracDriver : INFO initialized experiment <exp_a_stop._MyExperiment object at 0x00000209EC20D408>
but it ignores the exp file and just plays the playlist in order on repeat!
OTHER TIMES it does not work at all, most recently using:
exp_a_stop.txt
config_a_items.txt
I used the same config and decided to just write a super basic experiment "stop experiment after 10 sec" and this resulted in the same below error.
exp_stop_self.txt
Process Process-3:
Traceback (most recent call last):
File "c:\fly-vr\flyvr\control\experiment.py", line 265, in new_from_python_file
exp = getattr(mod, 'experiment')
AttributeError: 'NoneType' object has no attribute 'experiment'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\murthylab\miniconda3\envs\flyvr\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\murthylab\miniconda3\envs\flyvr\lib\multiprocessing\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "c:\fly-vr\flyvr\fictrac\fictrac_driver.py", line 109, in run
setup_experiment(options)
File "c:\fly-vr\flyvr\common\build_arg_parser.py", line 181, in setup_experiment
_experiment_obj = Experiment.new_from_python_file(options.experiment_file)
File "c:\fly-vr\flyvr\control\experiment.py", line 270, in new_from_python_file
raise RuntimeError('experiment python file must define single variable of type Experiment')
RuntimeError: experiment python file must define single variable of type Experiment
also - just to make sure i wasn't going crazy - I also ran an audiovisual set (audiovisual playlist and randomization in experiment.py file) from yesterday and this worked...
from fly-vr.
Calling Experiment.stop()
isn't going to work, I wrote that just to unambiguously convey the function name. It's not a class or static method so it's self.stop()
Strange that the bug seems not reliably reproducible.
from fly-vr.
Oh and it also could be that RuntimeError: experiment python file must....
is the error that gets printed if there is a syntax error or exception in or before __init__()
Easiest way to check for syntax errors is from memory, just to run the experiment.py
aka $ python experiment.py
- I'm pretty sure it will no-op but at least the interpreter checks the syntax.
from fly-vr.
ah! thanks for the suggestion. yeah there was an extra space creating an indent issues. got self.stop( )
to work. thanks so much!
from fly-vr.
Related Issues (20)
- 2P control (next-image scanimage signaling) HOT 2
- docs: audio playlist item definition and channels
- docs: hwio
- replay experiment 'experiment' HOT 1
- attenuator that works with non-tonal stimuli HOT 3
- daq backend starts immediately in allinone launcher HOT 2
- daq backend: support the IPC verbs HOT 1
- daq: analog output what to do when playlist ends HOT 1
- more granular 'next event' logging (detect chunks of different provenance ) HOT 1
- linux support
- video: calibration file path
- add Experiment.stop() HOT 2
- Missing entry in TOC file for first video stimulus in playlist mode. HOT 21
- Issues with scan trigger timing HOT 5
- More control of video playback from experiment.py files. HOT 1
- Adding last two FicTrac-v2 columns to get saved into FlyVR
- Adding 2 channel (stereo) audio delivery to FlyVR HOT 1
- Store and project any set of movies, ultimately in CL HOT 2
- test video playlist and experimental logic HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fly-vr.