Skip to content

Conditional keep outputs #1612

@ashgillman

Description

@ashgillman

I have developed some interfaces that work with Interfiles, which are a two (or three) part file. One (or two) header(s) and one data file.

Currently, to prevent deletion of the data files I have to pass every file around twice, so I have inputs.in1_header, inputs.in1_data, etc. Whereas for these filetypes, if the header is required, the data file is always required. It would be great if I could specify in the output_spec that if out is a required output, the node should also not delete a file with the same name but a different extension that I could specify.

Similarly, I have an interface that takes a pattern as an input, rather than a list. If I want to pass an output that is actually a file pattern to this input, it would be good if I could keep files matching that pattern (e.g., output_%d.hv). This is a bit trickier, because it is arbitrary what type of pattern to use. My current workaround is either specify the pattern and the list as an output, and point the list somewhere so it is kept, or disabling cleaning for the Node.

Maybe you could specify a lambda in the output trait that matches files to keep? Or would this create pickling errors?

I'd be happy to help out with this, if it is something that the developers want.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions