Example #1
0
def anothermethod(data, calfile, threshold=6):
    provenance.add_input(calfile)
    # do method
    return 0
Example #2
0
def anothermethod(data, calfile, threshold=6):
    provenance.add_input(calfile)
    # do method
    return 0
Example #3
0
def anothermethod(data, calfile, threshold=6):
    provenance.add_input(calfile)
    # do method
    return 0


# activity: all method parameters are fixed

if __name__ == '__main__':

    with provenance.activity(name="reconstruction", output="prov.fits"):

        # inputs (entities) can be added at any time (even in sub-modules)
        # with copy=True, any provenance info in the file is read in
        # (e.g. previous Activities).
        provenance.add_input(lfn="/data/stuff/somedatafile.fits", copy=True)
        provenance.add_input(lfn="/data/stuff/anotherfile.fits")

        # also, config parameters can be registered, grouped by some
        # identifier like the algorithm name (this could be done
        # automatically in each algorithm).
        config = {'x': 3, 'var': 'test', 'cut': (-1, 3)}
        provenance.add_activity("myalogorithm", params=config, version=1)
        provenance.add_activity(anothermethod)

        # do stuff... (TOOL CODE HERE)

    # when the activity context-manager ends, the status is recorded
    # (any exceptions will be caught and the status set).
    #
    # The output file is written, containing an ActivityCollection
Example #4
0
    provenance.add_input(calfile)
    # do method
    return 0


# activity: all method parameters are fixed


if __name__ == "__main__":

    with provenance.activity(name="reconstruction", output="prov.fits"):

        # inputs (entities) can be added at any time (even in sub-modules)
        # with copy=True, any provenance info in the file is read in
        # (e.g. previous Activities).
        provenance.add_input(lfn="/data/stuff/somedatafile.fits", copy=True)
        provenance.add_input(lfn="/data/stuff/anotherfile.fits")

        # also, config parameters can be registered, grouped by some
        # identifier like the algorithm name (this could be done
        # automatically in each algorithm).
        config = {"x": 3, "var": "test", "cut": (-1, 3)}
        provenance.add_activity("myalogorithm", params=config, version=1)
        provenance.add_activity(anothermethod)

        # do stuff... (TOOL CODE HERE)

    # when the activity context-manager ends, the status is recorded
    # (any exceptions will be caught and the status set).
    #
    # The output file is written, containing an ActivityCollection