<commit_before>(ns kixi.hecuba.web-paths)

(def paths
  {;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;; WEB UI
   :login "login"
   :logout "logout"
   :app "app"
   :admin "admin"
   :profile "profile" ;; user profile settings

   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;; API

   ;; programmes
   :programmes-index "programmes"
   :programme-resource "programmes/%s"

   ;; projects
   :programme-projects-index "programmes/%s/projects"
   :programme-projects-resource "programmes/%s/projects/%s"
   :projects-index "projects"
   :project-resource "projects/%s"
   :project-properties-index "projects/%s/properties"

   ;; enitites
   :entities-index "entities"    
   :entity-resource "entities/%s"

   ;; datasets
   :entity-datasets-index "entities/%s/datasets"
   :entity-dataset-resource "entities/%s/datasets/%s"

   ;; devices
   :entity-devices-index "entities/%s/devices"
   :entity-device-resource "entities/%s/devices/%s"

   ;; profiles
   :entity-profiles-index "entities/%s/profiles"
   :entity-profiles-resource "entities/%s/profiles/%s"

   ;; measurements
   :entity-device-measurement-index "enitites/%s/devices/%s/measurements"
   :entity-device-measurement-readingtype-index "enitites/%s/devices/%s/measurements/%s"
   :entity-device-measurement-readingtype-resource "enitites/%s/devices/%s/measurements/%s/%s"

   ;; hourly readings
   ;; FIXME: This should be a query parameter and not a separate resource (or rather the raw should force not choosing the hourly/daily)
   :entity-device-measurement-readingtype-hourly-rollups "entities/%s/devices/%s/hourly_rollups/%s"

   ;; daily readings
   ;; FIXME: This should be a query parameter and not a separate resource
   :entity-device-measurement-readingtype-daily-rollups "entities/%s/devices/%s/daily_rollups/%s"
   })

(defn compojure-route
  ([route keys]
     (str "/" (apply (partial format (route paths)) keys)))
  ([route]
     (compojure-route route [])))

(def amon-api-version "4")

(defn amon-index-route
  ([route keys]
     (str "/" amon-api-version (compojure-route route keys) "/"))
  ([route]
     (amon-index-route route [])))

(defn amon-resource-route
  ([route keys]
     (str "/" amon-api-version (compojure-route route keys)))
  ([route]
     (amon-resource-route route [])))

(defn index-path-string
  [route]
  (str "/" amon-api-version "/" (route paths) "/"))

(defn resource-path-string
  [route]
  (str "/" amon-api-version "/" (route paths)))
<commit_msg>I really need to learn how to spell entities.<commit_after>(ns kixi.hecuba.web-paths)

(def paths
  {;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;; WEB UI
   :login "login"
   :logout "logout"
   :app "app"
   :admin "admin"
   :profile "profile" ;; user profile settings

   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;; API

   ;; programmes
   :programmes-index "programmes"
   :programme-resource "programmes/%s"

   ;; projects
   :programme-projects-index "programmes/%s/projects"
   :programme-projects-resource "programmes/%s/projects/%s"
   :projects-index "projects"
   :project-resource "projects/%s"
   :project-properties-index "projects/%s/properties"

   ;; enitites
   :entities-index "entities"    
   :entity-resource "entities/%s"

   ;; datasets
   :entity-datasets-index "entities/%s/datasets"
   :entity-dataset-resource "entities/%s/datasets/%s"

   ;; devices
   :entity-devices-index "entities/%s/devices"
   :entity-device-resource "entities/%s/devices/%s"

   ;; profiles
   :entity-profiles-index "entities/%s/profiles"
   :entity-profiles-resource "entities/%s/profiles/%s"

   ;; measurements
   :entity-device-measurement-index "entities/%s/devices/%s/measurements"
   :entity-device-measurement-readingtype-index "entities/%s/devices/%s/measurements/%s"
   :entity-device-measurement-readingtype-resource "entities/%s/devices/%s/measurements/%s/%s"

   ;; hourly readings
   ;; FIXME: This should be a query parameter and not a separate resource (or rather the raw should force not choosing the hourly/daily)
   :entity-device-measurement-readingtype-hourly-rollups "entities/%s/devices/%s/hourly_rollups/%s"

   ;; daily readings
   ;; FIXME: This should be a query parameter and not a separate resource
   :entity-device-measurement-readingtype-daily-rollups "entities/%s/devices/%s/daily_rollups/%s"
   })

(defn compojure-route
  ([route keys]
     (str "/" (apply (partial format (route paths)) keys)))
  ([route]
     (compojure-route route [])))

(def amon-api-version "4")

(defn amon-index-route
  ([route keys]
     (str "/" amon-api-version (compojure-route route keys) "/"))
  ([route]
     (amon-index-route route [])))

(defn amon-resource-route
  ([route keys]
     (str "/" amon-api-version (compojure-route route keys)))
  ([route]
     (amon-resource-route route [])))

(defn index-path-string
  [route]
  (str "/" amon-api-version "/" (route paths) "/"))

(defn resource-path-string
  [route]
  (str "/" amon-api-version "/" (route paths)))

{'fraction_non_alphanumeric': 0.20083102493074792, 'fraction_numerical': 0.0003957261574990107, 'mean_word_length': 3.8512476007677545, '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': '4866530', 'n_tokens_mistral': 1797, 'n_tokens_neox': 1669, 'n_words': 328}