File "/home/jrporter/miniconda2/envs/std3/bin/jug", line 11, in <module> load_entry_point('Jug==1.6.7+git', 'console_scripts', 'jug')() File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/jug.py", line 278, in main cmdapi.run(options.subcommand, options=options, store=store, jugspace=jugspace) File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/subcommands/__init__.py", line 271, in run return cmd(*args, **kwargs) File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/subcommands/__init__.py", line 161, in __call__ return self.run(*args, **kwargs) File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/subcommands/execute.py", line 93, in run failures = execution_loop(tasks, options) or failures File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/jug.py", line 195, in execution_loop t.run(debug_mode=options.debug) File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/task.py", line 111, in run self._result = self._execute() File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/task.py", line 119, in _execute args = [value(dep) for dep in self.args] File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/task.py", line 119, in <listcomp> args = [value(dep) for dep in self.args] File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/task.py", line 476, in value return elem.value() File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/task.py", line 130, in value return self.result File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/task.py", line 125, in _get_result if not hasattr(self, '_result'): self.load() File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/task.py", line 167, in load self._result = self.store.load(self.hash()) File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/backends/file_store.py", line 228, in load return decode_from(input) File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/backends/encode.py", line 195, in decode_from return pickle.load(stream) File "/home/jrporter/miniconda2/envs/std3/lib/python3.6/site-packages/Jug-1.6.7+git-py3.6.egg/jug/backends/encode.py", line 121, in read res += self.D.decompress(buf, nbytes - len(res))
Aha. I would be certainly open to implementing this.
With the proviso that I don’t totally understand how all the objects relate together, I can see a couple of ways this might work.
I’m imagining something like jug.value(task.t, mmap_mode=’r’), where the *args and **kwargs are just propagated forward to the load call in the store. That way there would be a general system for providing additional keyword arguments for load functions in the future.
2. Add some kind of setting to the file_store, so that you can modify its behavior globally (or maybe just for the calling task). I’m imagining something like
backend.save_numpy_as_compressed (False)
backend.load_as_memmap(True)
(You could also imagine things like backend.save_memmap())
3. Decorators/parameters to @TaskGenerator to indicate saving behavior, e.g.:
@TaskGenerator(load_mmap_mode=’r’)
def do_something_strided(list_of_tasks, stride=1):
…
What do you think?
Cheers!
JRP
2. Add some kind of setting to the file_store, so that you can modify its behavior globally (or maybe just for the calling task). I’m imagining something like
backend.save_numpy_as_compressed (False)
backend.load_as_memmap(True)
(You could also imagine things like backend.save_memmap())