<commit_before>(ns cmr.spatial.test.ring-generators
  "Tests that sanity check the ring generators"
  (:require
   [clojure.math.combinatorics :as combo]
   [clojure.string :as str]
   [clojure.test :refer :all]
   [clojure.test.check.generators :as gen]
   [clojure.test.check.properties :refer [for-all]]
   [cmr.common.test.test-check-ext :as ext-gen :refer [defspec]]))

;; Ring tests. These are functions that return true if the ring is correct and false if invalid.

(defn start-and-end-with-same-point
  [{:keys [points]}]
  (= (first points) (last points)))

(defn points-unique
  "The points are all unique."
  [{:keys [points]}]
  (= (dec (count points)) (count (set points))))

(defn consecutive-points-not-antipodal
  [{:keys [points]}]
  (let [point-pairs (partition 2 1 points)]
    (nil? (some (partial apply p/antipodal?) point-pairs))))

(defn contains-1-or-0-poles
  [{:keys [contains-north-pole contains-south-pole]}]<commit_msg>CMR-5500: Add back in accidently removed requires.<commit_after>(ns cmr.spatial.test.ring-generators
  "Tests that sanity check the ring generators"
  (:require
   [clojure.math.combinatorics :as combo]
   [clojure.string :as str]
   [clojure.test :refer :all]
   [clojure.test.check.generators :as gen]
   [clojure.test.check.properties :refer [for-all]]
   [cmr.common.test.test-check-ext :as ext-gen :refer [defspec]]
   [cmr.spatial.arc :as a]
   [cmr.spatial.derived :as d]
   [cmr.spatial.geodetic-ring :as gr]
   [cmr.spatial.math :refer :all]
   [cmr.spatial.mbr :as mbr]
   [cmr.spatial.point :as p]
   [cmr.spatial.ring-relations :as rr]
   [cmr.spatial.test.generators :as sgen]
   [cmr.spatial.validation :as v]))

;; Ring tests. These are functions that return true if the ring is correct and false if invalid.

(defn start-and-end-with-same-point
  [{:keys [points]}]
  (= (first points) (last points)))

(defn points-unique
  "The points are all unique."
  [{:keys [points]}]
  (= (dec (count points)) (count (set points))))

(defn consecutive-points-not-antipodal
  [{:keys [points]}]
  (let [point-pairs (partition 2 1 points)]
    (nil? (some (partial apply p/antipodal?) point-pairs))))

(defn contains-1-or-0-poles
  [{:keys [contains-north-pole contains-south-pole]}]
{'fraction_non_alphanumeric': 0.15652951699463327, 'fraction_numerical': 0.005366726296958855, 'mean_word_length': 3.9491150442477876, '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': '5446720', 'n_tokens_mistral': 858, 'n_tokens_neox': 824, 'n_words': 214}