<commit_before>(ns lcmap.aardvark.shared
  (:require [clojure.tools.logging :as log]
            [lcmap.aardvark.config :as config]
            [mount.core :as mount]
            [clojure.java.io :as io]))

(defn test-config
  "Start the app."
  ([]
   (test-system "lcmap-landsat-test.edn"))
  ([cfg-path]
   (try
     (log/debugf "Starting app with `%s`" cfg-path)
     (let [cfg (config/build {:edn cfg-path})]
       (mount/start-with {#'lcmap.aardvark.state/config cfg}))
     (catch java.io.FileNotFoundException e
       (log/error "File not found, is `lcmap-landsat-test.edn` on the load path?")))))

(defmacro with-system
  "Start and stop the system, useful for integration tests."
  [[binding] & body]
  `(let [cfg (config/build {:edn (io/resource "lcmap-landsat-test.edn")})
         ~binding (mount/start-with {#'lcmap.aardvark.state/config cfg})]
     (try
       (do ~@body)
       (finally
         (mount/stop ~binding)))))<commit_msg>removing unused code<commit_after>(ns lcmap.aardvark.shared
  (:require [clojure.tools.logging :as log]
            [lcmap.aardvark.config :as config]
            [mount.core :as mount]
            [clojure.java.io :as io]))

(defmacro with-system
  "Start and stop the system, useful for integration tests."
  [[binding] & body]
  `(let [cfg (config/build {:edn (io/resource "lcmap-landsat-test.edn")})
         ~binding (mount/start-with {#'lcmap.aardvark.state/config cfg})]
     (log/debug "Starting test system with config:" cfg)
     (try
       (do ~@body)
       (finally
         (mount/stop ~binding)))))
{'fraction_non_alphanumeric': 0.15708812260536398, 'fraction_numerical': 0.0, 'mean_word_length': 2.794188861985472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3805928', 'n_tokens_mistral': 562, 'n_tokens_neox': 556, 'n_words': 132}