Showing 1 of 2 files from the diff.
Other files ignored by Codecov
Project.toml has changed.

@@ -96,7 +96,7 @@
Loading
96 96
    if _has_pip() && _isyes(Base.prompt("Try updating arviz using pip? [Y/n]"))
97 97
        # can't specify version lower bound, so update to latest
98 98
        try
99 -
            run(`$(PyCall.pyprogramname) -m pip install --upgrade -- arviz`)
99 +
            run(PyCall.python_cmd(`-m pip install --upgrade -- arviz`))
100 100
            return true
101 101
        catch e
102 102
            println(e.msg)
@@ -105,21 +105,21 @@
Loading
105 105
    return false
106 106
end
107 107
108 -
function _import_dependency(modulename, pkgname; channel = nothing)
109 -
    _has_pymodule(modulename) && return pyimport(modulename)
110 -
    return if _using_conda()
111 -
        # auto-installing with conda is safe and convenient
112 -
        if channel === nothing
108 +
function _import_dependency(modulename, pkgname = modulename; channel = nothing)
109 +
    try
110 +
        return if channel === nothing
113 111
            pyimport_conda(modulename, pkgname)
114 112
        else
115 113
            pyimport_conda(modulename, pkgname, channel)
116 114
        end
117 -
    elseif _has_pip() && _isyes(Base.prompt("Try installing $pkgname using pip? [Y/n]"))
118 -
        # installing with pip is riskier, so we ask for permission
119 -
        run(`$(PyCall.pyprogramname) -m pip install -- $pkgname`)
120 -
        pyimport(modulename)
121 -
    else
122 -
        error("Dependency $modulename cannot be imported. Install manually to continue.")
115 +
    catch e
116 +
        if _has_pip() && _isyes(Base.prompt("Try installing $pkgname using pip? [Y/n]"))
117 +
            # installing with pip is riskier, so we ask for permission
118 +
            run(PyCall.python_cmd(`-m pip install -- $pkgname`))
119 +
            return pyimport(modulename)
120 +
        end
121 +
        # PyCall has a nice error message
122 +
        throw(e)
123 123
    end
124 124
end
125 125
@@ -127,6 +127,6 @@
Loading
127 127
128 128
_using_conda() = PyCall.conda
129 129
130 -
_has_pip() = ispynull(pyimport_e("pip"))
130 +
_has_pip() = _has_pymodule("pip")
131 131
132 132
_has_pymodule(modulename) = !ispynull(pyimport_e(modulename))
Files Coverage
src 88.06%
Project Totals (13 files) 88.06%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading