basedir = 'test' FT = ContextDict('ft') ft = FT.accessor() FILES = ContextDict('files', basedir=basedir) FILES.update({ 'contentdir': '{{ft.content}}/', 'headers': '{{ft.content}}/headers.pickle', 'columns': '{{ft.content}}/columns.pickle', 'columns_all': '{{ft.content}}/columns_all.pickle', 'msiddir': '{{ft.content}}/msid/', 'msid': '{{ft.content}}/msid/{{ft.msid}}', 'archdir': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/', 'archfile': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/{{ft.basename}}', }) files = FILES.accessor() # Original archive files OFILES = ContextDict('of', basedir='/data/cosmos2/tlm') OFILES.update({ 'contentdir': '{{ft.content}}/', })
from pyyaks.context import ContextDict # datadir = '/data/baffin3/telem_archive/data' datadir = 'data' ft = ContextDict('ft') files = ContextDict('files', basedir=datadir) files.update({'contentdir': '{{ft.content}}/', 'headers': '{{ft.content}}/headers.pickle', 'colnames': '{{ft.content}}/colnames.pickle', 'colnames_all': '{{ft.content}}/colnames_all.pickle', 'archfiles': '{{ft.content}}/archfiles.db3', 'msiddir': '{{ft.content}}/msid/', 'msid': '{{ft.content}}/msid/{{ft.msid}}.h5', 'qual': '{{ft.content}}/{{ft.msid}}_qual.h5', 'oldmsid': '{{ft.content}}/{{ft.msid}}.h5', # 'oldmsid': 'test.h5', 'archdir': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/', 'archfile': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/{{ft.basename}}', }) # Original archive files ofiles = ContextDict('of', basedir='/data/cosmos2/tlm') ofiles.update({'contentdir': '{{ft.content}}/', })
import pyyaks.context from pyyaks.task import task, chdir, setenv, depends from pyyaks.context import render, ContextDict, render_args logger = pyyaks.logger.get_logger() # Create a context dictionary to store attributes of the input file # that is being processed INPUT = ContextDict('input') # Input = INPUT.accessor() # Create a context dictionary to store file name definitions FILE = ContextDict('file', basedir='word_index') FILE.update({'out_dir': '{{input.filebase}}', 'file_link': '{{input.filebase}}/{{input.filename}}', 'word_alpha': '{{input.filebase}}/word_alpha', 'word_freq': '{{input.filebase}}/word_freq', 'index': '{{input.filebase}}/index', }) File = FILE ###################################################################################### @task() @depends(targets=[FILE['out_dir']]) def make_out_dir(): """Make the output directory where output created by the processing for this input file""" os.makedirs(File['out_dir'].rel) ###################################################################################### @task()
from pyyaks.context import ContextDict basedir = "test" FT = ContextDict("ft") ft = FT.accessor() FILES = ContextDict("files", basedir=basedir) FILES.update( { "contentdir": "{{ft.content}}/", "headers": "{{ft.content}}/headers.pickle", "columns": "{{ft.content}}/columns.pickle", "columns_all": "{{ft.content}}/columns_all.pickle", "msiddir": "{{ft.content}}/msid/", "msid": "{{ft.content}}/msid/{{ft.msid}}", "archdir": "{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/", "archfile": "{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/{{ft.basename}}", } ) files = FILES.accessor() # Original archive files OFILES = ContextDict("of", basedir="/data/cosmos2/tlm") OFILES.update({"contentdir": "{{ft.content}}/"}) ofiles = OFILES.accessor()
# Licensed under a 3-clause BSD style license - see LICENSE.rst from pyyaks.context import ContextDict # datadir = '/data/baffin3/telem_archive/data' datadir = 'data' ft = ContextDict('ft') files = ContextDict('files', basedir=datadir) files.update({'contentdir': '{{ft.content}}/', 'headers': '{{ft.content}}/headers.pickle', 'colnames': '{{ft.content}}/colnames.pickle', 'colnames_all': '{{ft.content}}/colnames_all.pickle', 'archfiles': '{{ft.content}}/archfiles.db3', 'msiddir': '{{ft.content}}/msid/', 'msid': '{{ft.content}}/msid/{{ft.msid}}.h5', 'qual': '{{ft.content}}/{{ft.msid}}_qual.h5', 'oldmsid': '{{ft.content}}/{{ft.msid}}.h5', # 'oldmsid': 'test.h5', 'archdir': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/', 'archfile': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/{{ft.basename}}', }) # Original archive files ofiles = ContextDict('of', basedir='/data/cosmos2/tlm') ofiles.update({'contentdir': '{{ft.content}}/', })
# Licensed under a 3-clause BSD style license - see LICENSE.rst from pyyaks.context import ContextDict basedir = 'test' FT = ContextDict('ft') ft = FT.accessor() FILES = ContextDict('files', basedir=basedir) FILES.update({'contentdir': '{{ft.content}}/', 'headers': '{{ft.content}}/headers.pickle', 'columns': '{{ft.content}}/columns.pickle', 'columns_all': '{{ft.content}}/columns_all.pickle', 'msiddir': '{{ft.content}}/msid/', 'msid': '{{ft.content}}/msid/{{ft.msid}}', 'archdir': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/', 'archfile': '{{ft.content}}/arch/{{ft.year}}/{{ft.doy}}/{{ft.basename}}', }) files = FILES.accessor() # Original archive files OFILES = ContextDict('of', basedir='/data/cosmos2/tlm') OFILES.update({'contentdir': '{{ft.content}}/', }) ofiles = OFILES.accessor()