Change Log
v0.12.1
- Compat: bring back
stdout_originandstderr_originthat were removed in v0.12.0. - Feat:
check_dependencynow has a new keywordforce=true, allowing force check no matter it is checked or not.
v0.12.0
- Feat:
run(::CmdProgram; stdout, stderr)now the command line will be redirected by stdout and stderr. Of course, if the command is a pipeline and has its own redirection, it use its own. - Feat/breaking: Stdout/stderr redirection is thread-safe by using
ScopedStreams.jlfrom v0.12.0. See details atredirect_stream. If you found an error related toScopedStream, please useScopedStreams.@gen_scoped_stream_methodsafter loading all modules. See details at ScopedStreams.jl. - Change/breaking: If a program fails, it directly throw an error now.
- Breaking: Remove
try_functionandStackTraceVector. - Fix:
check_dependencynow checkexit_when_fail=falseto determine throw errors or not. - Feat: do not check dependency if it is checked when run programs.
- Fix:
check_dependency_dirhas a typo. - Change:
arg_completion: useerrorinstead ofthrow(ErrorException(...)), because the later performs different in test and normal julia environment. - Change: remove
stdout_originandstderr_origin. - More code coveage.
v0.11.2
- Deps: from newer Julia,
redirect_to_filesdo not need to show error because Julia handle it automatically.
v0.11.1
- Fix: use
tryisfile(f)instead ofisfile(f)incmd_to_run_id_linesbecause the latter might cause name too long error.
v0.11.0
- Feat/Breaking: new method
auto_change_directory(b::Bool). It is necessary because changing directory is not thread-safe in Julia. It was set tofalsein v0.11.0. To make your code compatible with previous version, you can addPipelines.auto_change_directory(true)at the beginning of your code, or use full paths through out your code (recommended). - Fix: creating run id file under try catch block.
v0.10.6
- Fix:
run(::Program): wrappwd()in try-catch block in case the dir no longer exists. It happens because workding dir is not thread safe in Julia. If other program delete the directory, it will fail.
v0.10.5
- Compat: Julia v1.10:
hasmethod(f, t)in Julia v1.10 changed its behavior. It affects Program function check. Uselength(methods(f, t))instead.
v0.10.4
- Compat: Julia v1.9: init(): change the if statement of printing Base.stdxxx was changed when initiating Pipelines.jl: now detects WindowsRawSocket.
v0.10.3
- Compat: Julia v1.9: init(): change the if statement of printing Base.stdxxx was changed when initiating Pipelines.jl: now detects RawFD.
v0.10.2
- Compat: Julia v1.9: init(): change the if statement of printing Base.stdxxx was changed when initiating Pipelines.jl: now detects
<fd> - Change
using FilePathsBasetoimport FilePathsBase:AbstractPathto avoid variable conflict.
v0.10.1
- Fix: the flaw of recursion of
keyword_interpolation.
v0.10.0
- Feature: remove reexport of FilePathsBase package to suppress warning 'Both Dates and FilePathsBase exports canonicalize'.
v0.9.10
- Fix:
run: wrapcd(dir_backup)in try-catch block in case the dir no longer exists. happens because workding dir is not thread safe in Julia. If other program delete the directory, it will fail.
v0.9.9
- Fix: redirection.jl: wrap all
redirect_stdXXXin the try-catch block.
v0.9.8
- Feature: flush ios after task finished (
redirect_to_files).
v0.9.6 - v0.9.7
- Fix: not showing warning when Base.stdout or Base.stderr is system file redirection (IOStream, fd) when initiating Pipelines.jl
v0.9.5
- Docs: add new page: tips and trobleshoots.
v0.9.4
- Docs: better documentation on run id file:
Pipelines.create_run_id_file. - Feature:
Pipelines.CMD_FILE_SPLITER.
v0.9.3
- Feature: run id file also try to record all possible files from Base.AbstractCmd inputs/outputs.
v0.9.2
- Feature: If skipping program, not showing
@infoof start. - Feature:
@logmsgdoes not show module, file, line etc.
v0.9.1
- Fix: pretty print of Pipelines types.
v0.9.0
- Feature: run id file contain file information to guess whether files are updated and better decide rerun.
- Fix: quote_function: func(a; b = b): if b is one of inputs or outputs, the first b does not change.
v0.8.6
- Feature: If any file (not dir) paths of the inputs are newer than the run id file, the program will run again to update the outputs, even if the run id file exists. (#4)
v0.8.5
- Feature: Enchance compatibility with JobSchedulers v0.6.12:
Programhas a new field calledarg_forwardthat is used to forward user-defined inputs/outputs to specific keyword arguments ofJobSchedulers.Job(::Program, ...), includingname::String,user::String,ncpu::Int,mem::Int.
v0.8.4
- Fix: If defining a
ProgramusingExprin other packages, the precompilation will fail due to the Expr will be@evalto a function inPipelines. Julia does not allow define new functions in a compiled module. To avoid this, we have to pass the current module toCmdProgramorJuliaProgram. In this fix, the two methods accepts a new keyword argumentmod, which allows users to passmod = @__MODULE__manually.
v0.8.2-3
- Feature: New
Argdata type for storing inputs and outputs information inProgram.arg_inputs::Vector{Arg}andarg_outputs::Vector{Arg}are new fields ofProgram. - Feature: If a
Argname of inputs/outputs is a Symbol, run id will not generate using this Arg, which is useful for args do not affect the results, such as nthread, ncpu. (#8) - Fix other issues.
- Docs: better documentation for v0.8 features.
v0.8.1
- Optimize:
dictreplace!(ex::AbstractString, s::Symbol, v::Expr)is now several times faster. - Docs: better documentation for v0.8 features.
v0.8.0
- Feature:
quote_functionallows user to use 'elements of inputs and outputs as variables' when defining Program. To use the feature, users can passquote ... endto Program's arguments that requiresFunctionbefore, such asmain,validate_inputs. From Pipelines v0.8, allExprprovided will be converted toFunctionautomatically. See details inquote_expr.
v0.7.8
- Feature:
check_reserved_xxputsdoes not needxxput_types::Vector{Type}.
v0.7.7
- Feature: now
run(p; kwargs...)works likeprog_run(p::Program; kwargs...). If originalinputs, outputsare given, and same keys inkwargs...are found, the latter will override the former. If program args are conflict with other arguments, an error will throw. - Feature:
infer_outputs(prog; INPUT1 = 5)now supportsrun-like kwargs. - Feature: Before creating new Program,
check_reserved_xxputsandcheck_function_methods.
v0.7.6
- Fix: replace
@runin v0.7.5 with a new functionprog_run(p::Program; kwargs...). The original@runonly works for global variables, otherwise you need to use@evaland complicated$to pass variables to AST. - Fix replace
@varsin v0.7.5 with a non-exported functionparse_program_args(p::Program; args...). It returns(inputs::Dict{String}, outputs::Dict{String}, kwargs::Tuple).
v0.7.5
- Feature (removed in v0.7.6): Simplify: new macro
@run program key_value_args... run_args...: Runprogramwithout creatinginputs::Dictandoutputs::Dict. The inputs and outputs are provided in the form ofkey = value, rather thanDict. - Feature (removed in v0.7.6): Simplify: new macro
@vars program::Program key_value_args...: Return run-able(inputs::Dict, outputs::Dict)forprogramusingkey_value_argsin the form ofkey = value.
v0.7.4
- Fix:
check_dependency(p::Program)return::Boolnow. - Feature:
check_dependency(p::CmdDependency; exit_when_fail::Bool = p.exit_when_fail): new argumentexit_when_failto overridep.exit_when_fail. - Feature: new function to check all
CmdDependencyandProgramunderm::Module:check_dependency(m::Module = @__MODULE__; exit_when_fail = true, verbose = true) - Feature: new function to display dependency status:
status_dependency(m::Module = @__MODULE__; exit_when_fail = false, verbose = true).
v0.7.3
- Fix a method overwrite warning when defining
Base.redirect_stdout(f::Function, ::Nothing) = f(): redirectstdout and redirectstderr are the same (::Base.RedirectStdStream) at least from julia v1.7, so defining redirectstdout means redirectstderr is also defined. If diff exists in previous julia versions, check first.
v0.7.2
- Optimize: do not show the error stack traces twice (
@errorandrethrow()).
v0.7.1
- Optimize: the returned value of the main function of
JuliaProgramdoes not required to be aDict. If it is not aDictor the returned Dict fails to pass keyword check, a warn message will be displayed and the inferredoutputswill be used. - Fix: MethodError: no method matching sort(::Dict{String, Any}) in
generate_run_uuid(...): importOrderedCollections.jl. - Optimize: do not show the error messages twice when
stderris not redirected.
v0.7.0
- Fix:
generate_run_uuid: more stable way to generate run UUID using inputs and outputs.
Caution: The UUIDs generated using old versions will be out of date, so if you run the same Program with the same parameters, the program will generate a different UUID. This is why it is considered as a breaking version.
v0.6.1
- Fix:
to_xxput_dict(d::Dict):vnot defined: changevtod. - Fix:
xxputs_completion_and_check(p, inputs, outputs): Now, ifoutputsare not empty andp.infer_outputsis defined, the function will first runp.infer_outputsand then merge the result andoutputs(user-input keys are kept). - Optimize: function
infer_outputs(p::Program, inputs)now works likexxputs_completion_and_checkbut only returnoutputs::Dict{String}. It does not affect user-defined functionp.infer_outputs. In addition,inputsis no longer strict toDict{String}because the it will convert toDict{String}first.
v0.6.0
- Feature: allow retry for failed program:
run(p::Program, ...; retry = 1). - Fix: the run id file generated after a successful run is under the directory specified in
run(p::Program, ...; dir = "directory"), ifp.id_fileis not an absolute path (default). - Feature:
verboseinrun(p::Program, ...; verbose = :min): Iftrueor:all, print all info and error messages. If:min, print minimum info and error messages. Iffalseor:none, print error messages only.
v0.5.2
- Fix: Export
restore_stderr.
v0.5.1
- Fix: stdxxx_origin set to nothing when reloading Pipelines from another module.
v0.5.0
- Optimize: stack traces of failed results.
- Fix: original stdout and stderr can be recovered by using
restore_stdout()andrestore_stderr(). Removeset_default_stdout()andset_default_stderr()because they cause confusion sometimes. - Optimize: default output of program info.
v0.4.6
- Fix: results of
isok(::AbstractString)should be expected.
v0.4.5
- Optimize: allow check dependencies when test argument is empty.
0.4.4
- Fix: change DataType to Type throughout the code. It allows successful parsing of Union Type, such as
"READ1" => Union{String, Vector{String}}.
v0.4.3
- Fix file redirecting exception when redirecting to a closed stream. Not solved: Redirecting in Julia are not thread safe, so unexpected redirection might be happen if you are running programs in different
Tasksor multi-thread mode.
v0.4.2
- Better error stack trace after capturing.
- Update file redirecting.
v0.4.1
- Fix file redirecting.
v0.4.0
- Feature:
run(p::Program, ...)supports running at a specified directory (dir). Run ID files will also create at that directory. - Feature:
run(p::Program, ...)supports redirectingstdout,stderrandstdlog(Julia log output, such as@info,@warn,@error). - Fix:
CmdProgramsupports commands such aspipeline(cmd, stdout=stderr), which redirect stdout to stderr now becauseprepare_cmd(h::Base.TTY, inputs, outputs)method is added.
v0.3.2
- Fix:
CmdDependency: do not check whentest_argsare empty.
v0.3.1
- Feature:
to_cmdandto_str: support argument::Regexor::Any.
v0.3.0
Feature: Building Program: Support type assertion and default arguments of
inputsandoutputs, such as"arg" => 5,"arg" => Int,"arg" => 5 => Int,"arg" => Int => 5.Feature:
Programandrun(::Program)no longer requireinputsandoutputsto beVectororDict. They can be bothVectororDict, or even an element ofVectororDict, as long as they can be converted. Eg:p = CmdProgram( cmd_dependencies = [julia], id_file = "id_file", inputs = [ "input", "input2" => Int, "optional_arg" => 5, "optional_arg2" => 0.5 => Number ], outputs = "output" => "<input>.output" , cmd = `echo input input2 optional_arg optional_arg2 output` ) inputs = Dict( "input" => `in1`, "input2" => 2 ) outputs = [ "output" => "out" ] run(p, inputs, outputs, skip_when_done = false, verbose = true, touch_run_id_file = false )Feature: Pretty print of
Program. Eg:julia> p CmdProgram: name → Command Program id_file → id_file info_before → auto info_after → auto cmd_dependencies → CmdDependency[`/usr/software/julia-1.4.2/bin/julia -Cnative -J/usr/software/julia-1.4.2/lib/julia/sys.so -O3 -g1`] inputs → "input" :: Any (required) "input2" :: Int64 (required) "optional_arg" :: Any (default: 5) "optional_arg2" :: Number (default: 0.5) validate_inputs → do_nothing prerequisites → do_nothing cmd → `echo input input2 optional_arg optional_arg2 output` infer_outputs → do_nothing outputs → "output" :: Any (default: <input>.output) validate_outputs → do_nothing wrap_up → do_nothing
v0.2.2
- Support JobSchedulers.jl.
v0.2.1
- Fix examples in docs.
v0.2.0
CmdDependency: Better interpolation in
Cmd.dep::CmdDepencendy # old version `$(dep.exec) --args` # or `$(exec(dep)) --args` # now `$dep --args`New
JuliaProgramfor pure Julia implementation.Programis the Abstract type containingCmdProgramandJuliaProgramsubstypes.