Utils
ElemCo.Utils — Modulevarious utilities
Exported functions
ElemCo.Utils.draw_endline — Functiondraw_endline()Print a line of ═.
ElemCo.Utils.draw_line — Functiondraw_line(n = 63)Print a thick line of n characters.
ElemCo.Utils.kwarg_provided_in_macro — Methodkwarg_provided_in_macro(kwargs, key::Symbol)Check whether key is in kwargs.
This is used in macros to check whether a keyword argument is passed. The keyword argument in question key is passed as a symbol, e.g. :thr. kwargs is the keyword argument list passed to the macro.
ElemCo.Utils.mainname — Methodmainname(file::String)Return the main name of a file, i.e. the part before the last dot and the extension.
Examples:
julia> mainname("~/test.xyz")
("test", "xyz")
julia> mainname("test")
("test", "")ElemCo.Utils.print_info — Functionprint_info(info::AbstractString, additional_info::AbstractString="")Print info between two lines.
If additional not empty: additional info after main.
ElemCo.Utils.print_time — Methodprint_time(EC::AbstractECInfo, t1, info::AbstractString, verb::Int)Print time with message info if verbosity verb is smaller than EC.verbosity.
ElemCo.Utils.subspace_in_space — Methodsubspace_in_space(subspace, space)Return the positions of subspace in space (with respect to space)
subspace and space are lists of indices with respect to the full space (e.g., 1:norb).
Examples
julia> get_subspace_of_space([1,3,5], [1,3,4,5])
3-element Array{Int64,1}:
1
2
4ElemCo.Utils.substr — Functionsubstr(string::AbstractString, start::Int, len::Int=-1)Return substring of string starting at start spanning len characters (including unicode). If len is not given, the substring spans to the end of string.
Example: julia julia> substr("λabδcd", 2, 3) "abδ"
ElemCo.Utils.substr — Methodsubstr(string::AbstractString, range::UnitRange{Int})Return substring of string defined by range (including unicode).
Example: julia julia> substr("λabδcd", 2:4) "abδ"
Internal functions
ElemCo.Utils.draw_thin_line — Functiondraw_thin_line(n = 63)Print a thin line of n characters.