Skip to content

Commit

Permalink
Remove asserts in push-compose-el-to-vs-queue
Browse files Browse the repository at this point in the history
Co-authored-by: @ghrpp <[email protected]>
Co-authored-by: @Nikita_Sinc <[email protected]>
  • Loading branch information
3 people committed Jan 9, 2024
1 parent 0eb5d64 commit 531b35b
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/ftr/extraction/ig/value_set_expand.clj
Original file line number Diff line number Diff line change
Expand Up @@ -171,29 +171,26 @@
has-concept-check? (some? check-fn)
any-system? (nil? system)
depends-on (vec depends-on)

_ (when (not has-concept-check?)
(assert (or (some? system) has-dependencies?)
"check fn may be missing only when depending on another value set or there's a system"))
_ (assert (or (not any-system?) has-dependencies?)
"system may be missing only when depending on another value set")

queue-path (concat [el-type]
(if any-system?
[:any-system]
[:systems system])
(if allow-any-concept?
[depends-on :allow-any-concept]
[depends-on :pred-fns]))]
(cond-> vs-queue
allow-any-concept?
(assoc-in queue-path true)

has-concept-check?
(update-in queue-path conj check-fn)

has-dependencies?
(update :deps (fnil into #{}) depends-on))))
(if (or (and (not has-concept-check?)
(not (or (some? system) has-dependencies?)))
(not (or (not any-system?) has-dependencies?)))
vs-queue
(cond-> vs-queue
allow-any-concept?
(assoc-in queue-path true)

has-concept-check?
(update-in queue-path conj check-fn)

has-dependencies?
(update :deps (fnil into #{}) depends-on)))))


(defn push-compose-els-to-vs-queue [vs-queue el-type els]
Expand Down

0 comments on commit 531b35b

Please sign in to comment.