forked from acalejos/exgboost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
115 lines (107 loc) · 3.66 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
defmodule EXGBoost.MixProject do
use Mix.Project
@version "0.2.1"
def project do
[
app: :exgboost,
version: @version,
make_precompiler: {:nif, CCPrecompiler},
make_precompiler_url:
"https://github.com/acalejos/exgboost/releases/download/v#{@version}/@{artefact_filename}",
make_precompiler_priv_paths: ["libexgboost.*", "lib"],
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
compilers: [:elixir_make] ++ Mix.compilers(),
deps: deps(),
docs: docs(),
package: package(),
preferred_cli_env: [
docs: :docs,
"hex.publish": :docs
],
before_closing_body_tag: &before_closing_body_tag/1,
name: "EXGBoost",
description:
"Elixir bindings for the XGBoost library. `EXGBoost` provides an implementation of XGBoost that works with
[Nx](https://hexdocs.pm/nx/Nx.html) tensors."
]
end
def application do
[
extra_applications: [:logger],
mod: {EXGBoost.Application, []}
]
end
defp deps do
[
{:elixir_make, "~> 0.4", runtime: false},
{:nimble_options, "~> 1.0"},
{:nx, "~> 0.5"},
{:jason, "~> 1.3"},
{:ex_doc, "~> 0.29.0", only: :docs},
{:cc_precompiler, "~> 0.1.0", runtime: false}
]
end
defp package do
[
maintainers: ["Andres Alejos"],
licenses: ["Apache-2.0"],
links: %{"GitHub" => "https://github.com/acalejos/exgboost"},
files: [
"lib",
"mix.exs",
"c",
"Makefile",
"README.md",
"LICENSE",
".formatter.exs",
"checksum.exs"
]
]
end
defp docs do
[
main: "EXGBoost",
before_closing_body_tag: &before_closing_body_tag/1
]
end
defp before_closing_body_tag(:html) do
"""
<!-- Render math with KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.0/dist/katex.min.css" integrity="sha384-t5CR+zwDAROtph0PXGte6ia8heboACF9R5l/DiY+WZ3P2lxNgvJkQk5n7GPvLMYw" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.0/dist/katex.min.js" integrity="sha384-FaFLTlohFghEIZkw6VGwmf9ISTubWAVYW8tG8+w2LAIftJEULZABrF9PPFv+tVkH" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.0/dist/contrib/auto-render.min.js" integrity="sha384-bHBqxz8fokvgoJ/sc17HODNxa42TlaEhB+w8ZJXTc2nZf1VgEaFZeZvT4Mznfz0v" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
]
});
});
</script>
<!-- Render diagrams with Mermaid -->
<script src="https://cdn.jsdelivr.net/npm/mermaid@8.13.3/dist/mermaid.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({ startOnLoad: false });
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition, function (svgSource, bindListeners) {
graphEl.innerHTML = svgSource;
bindListeners && bindListeners(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
end
defp before_closing_body_tag(_), do: ""
end