Liking cljdoc? Tell your friends :D

vl-data-insert.core


append-and-replaceclj

(append-and-replace struct {t :Type v :Value u :Unit n :N s :SdValue})

Append :Value, :SdValue and :N if present. Relaces :Type and :Unit.

Append `:Value`, `:SdValue` and `:N` if present. Relaces `:Type` and
`:Unit`.
sourceraw docstring

fit-in-structclj

(fit-in-struct s m)

Fits m into the given structure s. Function looks up the :Type of m. If a structure with the same :Type exist append-and-replace is called.

Fits `m` into the given structure `s`. Function looks up the
`:Type` of `m`. If a structure with the same `:Type` exist
[[append-and-replace]] is called.
sourceraw docstring

store-resultclj

(store-result d x p)

Stores the result x(ensured to be a map m) in the given document under path. If m contains :Type and :Value m is fit-in-struct and the structure s is assumed to be a vector. Other cases (e.g. merge in :AuxValues) are straight forward (see [[vl-data-insert/test/cmp/doc_test.clj]] for details).

Stores the result `x`(ensured to be a map `m`) in the given
`d`ocument under `p`ath. If `m` contains `:Type` and `:Value` `m`
is [[fit-in-struct]] and the structure `s` is assumed to be a
`vector`. Other cases (e.g. merge in `:AuxValues`) are straight
forward (see [[vl-data-insert/test/cmp/doc_test.clj]] for details).
sourceraw docstring

store-resultsclj

(store-results doc v p)

Takes a vector of maps. Calls store-result on each map.

Example:

(def p "Calibration.Measurement.Values.Pressure")
(def m {:Type    "a"
      :Unit    "b"
      :Value   [0]
      :SdValue [0]
      :N       [1]})

(def d {:Calibration
       {:Measurement
        {:Values
         {:Pressure
         [{:Type    "a"
          :Unit    "b"
          :Value   [0]
          :SdValue [0]
          :N       [1]}]}}}})

(store-results d [m m m m] p)

;; =>
;;   {:Calibration
;;    {:Measurement
;;     {:Values
;;      {:Pressure
;;       [{:Type "a",
;;         :Unit "b",
;;         :Value [0 0 0 0 0],
;;         :SdValue [0 0 0 0 0],
;;         :N [1 1 1 1 1]}]}}}}
Takes a vector of maps. Calls `store-result` on each map.

Example:
```clojure
(def p "Calibration.Measurement.Values.Pressure")
(def m {:Type    "a"
      :Unit    "b"
      :Value   [0]
      :SdValue [0]
      :N       [1]})

(def d {:Calibration
       {:Measurement
        {:Values
         {:Pressure
         [{:Type    "a"
          :Unit    "b"
          :Value   [0]
          :SdValue [0]
          :N       [1]}]}}}})

(store-results d [m m m m] p)

;; =>
;;   {:Calibration
;;    {:Measurement
;;     {:Values
;;      {:Pressure
;;       [{:Type "a",
;;         :Unit "b",
;;         :Value [0 0 0 0 0],
;;         :SdValue [0 0 0 0 0],
;;         :N [1 1 1 1 1]}]}}}}
```

sourceraw docstring

vector-valsclj

(vector-vals m)

Ensures that the values of :Value,:SdValue and :N are vectors.

Ensures that the values of `:Value`,`:SdValue` and `:N` are
vectors.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close