Skip to content

Commit

Permalink
2.3.3-la
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaspazza committed Nov 20, 2024
1 parent e2b6508 commit 7581a52
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 103 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/validation_delaguardo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
java-version: '22'

- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@12.5
uses: DeLaGuardo/setup-clojure@13.0
with:
cli: 1.12.0.1479 # Clojure CLI based on tools.deps
bb: 1.4.192 # Babashka
clj-kondo: 2024.09.27 # Clj-kondo
bb: 1.12.195 # Babashka
clj-kondo: 2024.11.14 # Clj-kondo
cljfmt: 0.13.0 # cljfmt
zprint: 1.2.9 # zprint
- name: Cache clojure dependencies
Expand Down
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "3.2.2-la"}}
{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "3.2.3-la"}}
:paths []
:tasks
{-base-deps {:doc "Dependencies for a task using bb"
Expand Down
16 changes: 8 additions & 8 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{:aliases
{:antq {:deps {com.github.liquidz/antq {:mvn/version "2.10.1241"}}
{:antq {:deps {com.github.liquidz/antq {:mvn/version "2.11.1250"}}
:main-opts ["-m" "antq.core"]}
:cljs-deps {:extra-deps {binaryage/devtools #:mvn{:version "1.0.7"}
criterium/criterium {:mvn/version "0.4.6"}
kixi/stats {:mvn/version "0.5.5"}
kixi/stats {:mvn/version "0.5.6"}
thedavidmeister/xoroshiro128 {:mvn/version "1.1.3"}
thheller/shadow-cljs #:mvn{:version "2.28.15"}}
thheller/shadow-cljs #:mvn{:version "2.28.19"}}
:extra-paths ["src/cljs" "src/cljc" "resources" "test/cljs" "test/cljc"]}
:common-test
{:exec-fn cognitect.test-runner.api/test
:extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner"
:sha "9d36f36ff541dac680a05010e4348c744333f191"}
:sha "3f288f1f16d167723ad87cc35b1dfee3c1681e10"}
org.clojure/tools.namespace #:mvn{:version "1.5.0"}
org.clojure/tools.reader #:mvn{:version "1.5.0"}}
:extra-paths ["test/clj" "test/cljc" "test/resources"]
Expand All @@ -20,14 +20,14 @@
:extra-deps {slipset/deps-deploy {:exclusions [org.slf4j/slf4j-nop]
:mvn/version "0.2.2"}}}
:env-development-repl
{:extra-deps {org.clojars.hephaistox/automaton-core #:mvn{:version "1.5.2-la"}}
{:extra-deps {org.clojars.hephaistox/automaton-core #:mvn{:version "1.5.3-la"}}
:extra-paths ["env/development/resources" "env/development/src/clj" "env/development/src/cljc"]
:jvm-opts ["-Dheph-conf=env/development/config.edn,env/common_config.edn"]
:main-opts ["-m" "automaton-optimization.repl.entry-point"]}
:env-development-test
{:exec-fn cognitect.test-runner.api/test
:extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner"
:sha "9d36f36ff541dac680a05010e4348c744333f191"}
:sha "3f288f1f16d167723ad87cc35b1dfee3c1681e10"}
org.clojure/tools.namespace {:mvn/version "1.5.0"}
org.clojure/tools.reader {:mvn/version "1.5.0"}}
:jvm-opts
Expand All @@ -36,8 +36,8 @@
"-Dlog4j.configurationFile=resources/log_config/appenders.properties,resources/log_config/logging-tests.properties"]
:main-opts ["-m" "cognitect.test-runner" "-r" ".*-test.*" "-d" "test/clj" "-d" "test/cljc"]}}
:deps {criterium/criterium {:mvn/version "0.4.6"}
kixi/stats {:mvn/version "0.5.5"}
org.clojars.hephaistox/automaton-core #:mvn{:version "1.5.2-la"}
kixi/stats {:mvn/version "0.5.6"}
org.clojars.hephaistox/automaton-core #:mvn{:version "1.5.3-la"}
org.clojure/clojure #:mvn{:version "1.12.0"}
thedavidmeister/xoroshiro128 #:mvn{:version "1.1.3"}}
:paths ["src/clj" "src/cljc" "resources" "src/cljs"]}
106 changes: 53 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"version": "0.0.0",
"author": "Hephaistox <[email protected]>",
"dependencies": {
"@sentry/browser": "^8.32.0"
"@sentry/browser": "^8.39.0"
},
"workspaces": [],
"devDependencies": {
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0",
"karma-cljs-test": "^0.1.0",
"shadow-cljs": "^2.28.15"
"shadow-cljs": "^2.28.19"
}
}
15 changes: 14 additions & 1 deletion src/cljc/automaton_optimization/maths.cljc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns automaton-optimization.maths
"Implements all mathematical basics functions compatible both with clj and cljs compiler and aiming at return the same results."
(:refer-clojure :exclude [infinite? abs min max])
(:refer-clojure :exclude [infinite? abs min max mod])
(:require
#?(:cljs [cljs.math :as math])
[xoroshiro128.core :as xoro]))
Expand All @@ -26,6 +26,12 @@

(def HALF_PI "Half PI" (/ PI 2.0))

(def interop-max-integer
"Returns same int value that's highest possible and equal for both clj and cljs. For refernce look at Integer/MAX_VALUE clojure interop documentation"
(- (Math/pow 2 31) 1))

(def interop-min-integer "same as interop-max-integer but for smallest" (- (Math/pow -2 31) 1))

(def infinity-integer
"Returns infinite for integer."
#?(:clj Integer/MAX_VALUE
Expand Down Expand Up @@ -93,6 +99,13 @@
(cond-> x
(neg? x) -))))


(defn mod
"Returns the modulus of dividing numerator n by denominator d."
[n d]
#?(:clj (clojure.core/mod n d)
:cljs (cljs.core/mod n d)))

(defn sqrt
"Square root of `x`, where `x∊[0;+∞[`."
[x]
Expand Down
14 changes: 0 additions & 14 deletions src/cljc/automaton_optimization/randomness.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,25 @@
([seed] (opt-prng-xoro/make seed))
([] (opt-prng-xoro/make)))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn built-in
"Creates an instance of the built-in prng of your platform (java or javascript)."
[]
(opt-prng-built-in/make))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn duplicate
"Duplicates this prng to a new one, starting at the seed value."
[this]
(opt-prng-stateful/duplicate this))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn jump "Jump to a completly different place." [this] (opt-prng-stateful/jump this))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn rnd-range
"Returns the range in which rnd is returned."
[this]
(opt-prng-stateful/rnd-range this))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn seed "Returns the seed of the random number generator." [this] (opt-prng-stateful/seed this))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn reset
"Returns a prng that starts again at the seed value."
[this]
Expand All @@ -61,19 +55,16 @@
[prng min-int max-int]
(opt-prng-stateful/as-int prng min-int max-int))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn as-int-pair
"Returns a pair of random integer between `[min-int; max-int[`."
[prng min-int max-int]
(let [rnd1 (as-int prng min-int max-int) rnd2 (as-int prng min-int max-int)] [rnd1 rnd2]))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn draw-ints
"Draw `n` random integers with `prng`, between `[min-int; max-int[`."
[prng n min-int max-int]
(opt-prng-stateful/draw-ints prng n min-int max-int))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn draw-doubles
"Draw `n` random doubles with `prng`, between `[min-int; max-int[`."
[prng n min-int max-int]
Expand All @@ -88,20 +79,15 @@

(defn distribution-registry "Returns the base registry." [] (opt-random-registry/registry))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn median
"Returns the median of the distribution"
([distribution] (opt-proba-distribution/median distribution))
([kw params] (opt-proba-distribution/median (build kw params))))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def cumulative "Returns the cumulative probability before `p`" opt-proba-distribution/cumulative)

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def minimum "Minimum" opt-proba-distribution/minimum)

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def maximum "Maximum" opt-proba-distribution/maximum)

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def quantile opt-proba-distribution/quantile)
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
(->Kixi (kixi-distribution/f {:d1 d1
:d2 d2}))))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn make-gamma-rate
"Returns a gamma distribution. `{:shape ∈ ℝ > 0, :rate ∈ ℝ > 0}`."
[shape rate]
Expand Down
Loading

0 comments on commit 7581a52

Please sign in to comment.