diff --git a/Sources/DiffractoGeometry/EllipseCalibration.swift b/Sources/DiffractoGeometry/EllipseCalibration.swift index f0167d1..b30632a 100644 --- a/Sources/DiffractoGeometry/EllipseCalibration.swift +++ b/Sources/DiffractoGeometry/EllipseCalibration.swift @@ -217,7 +217,6 @@ public enum EllipseCalibration { struct ProgressSpan { let report: (@Sendable (Double) -> Void)? let start: Double, end: Double - static let none = ProgressSpan(report: nil, start: 0, end: 1) func callAsFunction(_ fraction: Double) { report?(start + (end - start) * min(1, max(0, fraction))) } diff --git a/Sources/DiffractoOrientation/ACOMMetal.swift b/Sources/DiffractoOrientation/ACOMMetal.swift index 449991a..a16c342 100644 --- a/Sources/DiffractoOrientation/ACOMMetal.swift +++ b/Sources/DiffractoOrientation/ACOMMetal.swift @@ -16,7 +16,6 @@ // import Foundation -import DiffractoCore #if canImport(Metal) import Metal #endif diff --git a/Sources/DiffractoOrientation/PhaseVectorTypes.swift b/Sources/DiffractoOrientation/PhaseVectorTypes.swift index 119ab07..a7790fd 100644 --- a/Sources/DiffractoOrientation/PhaseVectorTypes.swift +++ b/Sources/DiffractoOrientation/PhaseVectorTypes.swift @@ -6,8 +6,6 @@ import Foundation import simd -import DiffractoCore -import DiffractoScattering // MARK: - Settings diff --git a/Tests/DiffractoCoreTests/CIFImportTests.swift b/Tests/DiffractoCoreTests/CIFImportTests.swift index 3f2c3b0..eeba635 100644 --- a/Tests/DiffractoCoreTests/CIFImportTests.swift +++ b/Tests/DiffractoCoreTests/CIFImportTests.swift @@ -262,7 +262,7 @@ struct CIFImportTests { """ - private func refusal(_ cif: String, _ file: StaticString = #filePath, line: UInt = #line) -> CIFImportError? { + private func refusal(_ cif: String) -> CIFImportError? { do { _ = try CIFImport.read(cif, fileBaseName: "t"); Issue.record("admitted"); return nil } catch { return error } } diff --git a/Tests/DiffractoCoreTests/CellStandardisationDisorderTests.swift b/Tests/DiffractoCoreTests/CellStandardisationDisorderTests.swift index 75c2c10..79aed46 100644 --- a/Tests/DiffractoCoreTests/CellStandardisationDisorderTests.swift +++ b/Tests/DiffractoCoreTests/CellStandardisationDisorderTests.swift @@ -5,7 +5,6 @@ // needs no expansion of its own. Exact (a fixed matrix on a fixed cell). // -import DiffractoKitTestSupport import Foundation import Testing import simd diff --git a/Tests/DiffractoCoreTests/ConventionalCellPinSupport.swift b/Tests/DiffractoCoreTests/ConventionalCellPinSupport.swift index 826c491..9e94c8e 100644 --- a/Tests/DiffractoCoreTests/ConventionalCellPinSupport.swift +++ b/Tests/DiffractoCoreTests/ConventionalCellPinSupport.swift @@ -137,5 +137,3 @@ func niggliViolations(_ v: [SIMD3], eps: Double) -> [String] { func metric(of vectors: [SIMD3]) -> [[Double]] { (0..<3).map { i in (0..<3).map { j in dot(vectors[i], vectors[j]) } } } - -func isUnimodularWithPositiveDeterminant(_ p: IntegerMatrix) -> Bool { p.determinant == 1 } diff --git a/Tests/DiffractoGeometryTests/EllipseStopRuleTests.swift b/Tests/DiffractoGeometryTests/EllipseStopRuleTests.swift index ddf0fa4..6e8b03d 100644 --- a/Tests/DiffractoGeometryTests/EllipseStopRuleTests.swift +++ b/Tests/DiffractoGeometryTests/EllipseStopRuleTests.swift @@ -16,7 +16,6 @@ // of the four rings throws `didNotConverge`. // -import DiffractoKitTestSupport import Testing import Foundation import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/EllipseTransformTests.swift b/Tests/DiffractoGeometryTests/EllipseTransformTests.swift index 7552838..e58dbd2 100644 --- a/Tests/DiffractoGeometryTests/EllipseTransformTests.swift +++ b/Tests/DiffractoGeometryTests/EllipseTransformTests.swift @@ -15,7 +15,6 @@ // RED UNDER: e = a/b for e = b/a; the axis swap of the returned pair dropped; the inverse's signs; `accepted` letting b <= 0 pass. // -import DiffractoKitTestSupport import Testing import Foundation import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/LinearScaleAssignmentTests.swift b/Tests/DiffractoGeometryTests/LinearScaleAssignmentTests.swift index 5ace971..8f9416a 100644 --- a/Tests/DiffractoGeometryTests/LinearScaleAssignmentTests.swift +++ b/Tests/DiffractoGeometryTests/LinearScaleAssignmentTests.swift @@ -1,4 +1,3 @@ -import DiffractoKitTestSupport import Foundation import Testing @testable import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/LinearScaleEstimateTests.swift b/Tests/DiffractoGeometryTests/LinearScaleEstimateTests.swift index 478f2ba..94b13f7 100644 --- a/Tests/DiffractoGeometryTests/LinearScaleEstimateTests.swift +++ b/Tests/DiffractoGeometryTests/LinearScaleEstimateTests.swift @@ -1,4 +1,3 @@ -import DiffractoKitTestSupport import Testing @testable import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/PolicyTests.swift b/Tests/DiffractoGeometryTests/PolicyTests.swift index 883e0a9..32524b0 100644 --- a/Tests/DiffractoGeometryTests/PolicyTests.swift +++ b/Tests/DiffractoGeometryTests/PolicyTests.swift @@ -11,7 +11,6 @@ import Testing import Foundation import DiffractoGeometry import DiffractoCore -import DiffractoScattering // MARK: - EllipseCalibration.Policy diff --git a/Tests/DiffractoGeometryTests/RingCalibrationTests.swift b/Tests/DiffractoGeometryTests/RingCalibrationTests.swift index ea5326b..0a3b98d 100644 --- a/Tests/DiffractoGeometryTests/RingCalibrationTests.swift +++ b/Tests/DiffractoGeometryTests/RingCalibrationTests.swift @@ -13,7 +13,6 @@ // equality. // -import DiffractoKitTestSupport import Testing import Foundation import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/RingFitCalibrationTests.swift b/Tests/DiffractoGeometryTests/RingFitCalibrationTests.swift index 2aa0f71..449d525 100644 --- a/Tests/DiffractoGeometryTests/RingFitCalibrationTests.swift +++ b/Tests/DiffractoGeometryTests/RingFitCalibrationTests.swift @@ -14,7 +14,6 @@ // Every test names under "RED UNDER" the production mutation that turns it red. // -import DiffractoKitTestSupport import Testing import Foundation import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/RingFitPolicyValidationTests.swift b/Tests/DiffractoGeometryTests/RingFitPolicyValidationTests.swift index e037dae..9014049 100644 --- a/Tests/DiffractoGeometryTests/RingFitPolicyValidationTests.swift +++ b/Tests/DiffractoGeometryTests/RingFitPolicyValidationTests.swift @@ -6,7 +6,6 @@ // Every test names under "RED UNDER" the production change that turns it red. // -import DiffractoKitTestSupport import Testing import Foundation import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/RingFitRobustnessTests.swift b/Tests/DiffractoGeometryTests/RingFitRobustnessTests.swift index 8d7ba80..ef4596c 100644 --- a/Tests/DiffractoGeometryTests/RingFitRobustnessTests.swift +++ b/Tests/DiffractoGeometryTests/RingFitRobustnessTests.swift @@ -9,7 +9,6 @@ // columns fastest, plus Gaussian noise from SplitMix64 + Box-Muller (the parity renderer's generator, seeded here). // -import DiffractoKitTestSupport import Testing import Foundation import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/RingOverlayTests.swift b/Tests/DiffractoGeometryTests/RingOverlayTests.swift index 65e5a65..1e237a5 100644 --- a/Tests/DiffractoGeometryTests/RingOverlayTests.swift +++ b/Tests/DiffractoGeometryTests/RingOverlayTests.swift @@ -5,7 +5,6 @@ // app source, NOT from this Swift. Closed forms (circle, axis vertex) are hand-derived and checked beside them. // -import DiffractoKitTestSupport import Foundation import Testing import DiffractoGeometry diff --git a/Tests/DiffractoGeometryTests/RingScaleTests.swift b/Tests/DiffractoGeometryTests/RingScaleTests.swift index 549bd68..995afa0 100644 --- a/Tests/DiffractoGeometryTests/RingScaleTests.swift +++ b/Tests/DiffractoGeometryTests/RingScaleTests.swift @@ -6,7 +6,6 @@ // 3.3e-15 for R, tools/pins/ring-calibration/q-pins.py); (2) the linear helper and the file comparison, closed forms. // -import DiffractoKitTestSupport import Foundation import Testing import DiffractoGeometry diff --git a/Tests/DiffractoKitParityTests/Orientation/Py4DSTEMRealFamilyTests.swift b/Tests/DiffractoKitParityTests/Orientation/Py4DSTEMRealFamilyTests.swift index 534a839..f63a258 100644 --- a/Tests/DiffractoKitParityTests/Orientation/Py4DSTEMRealFamilyTests.swift +++ b/Tests/DiffractoKitParityTests/Orientation/Py4DSTEMRealFamilyTests.swift @@ -2,7 +2,6 @@ import DiffractoKitTestSupport import Foundation import Testing import simd -import DiffractoCore import DiffractoOrientation /// Pins: tools/pins/orientation-symmetry/family-real-pins.py. Real py4DSTEM `Crystal`s (0.14.19 at f050d207, pymatgen 2025.1.9 and spglib 2.8.0 in @@ -11,7 +10,6 @@ import DiffractoOrientation /// order is pymatgen's. Written tolerance: 1e-7 absolute (the reference's tolerance; was 1e-12) on family entries (float64 sums of three products of order 1). Columns /// within 1e-12 of a sector wall (`boundary`) are decided by BLAS rounding in NumPy and are not compared. private struct RealPins: Decodable { - struct Lattice: Decodable { let a, b, c, alpha, beta, gamma: Double } struct Case: Decodable { let matrix, family: [[Double]]; let hits: [Int]; let boundary: [Bool] } struct Crystal: Decodable { let `class`: String; let spaceGroup: Int; let symbol: String; let primary: Bool diff --git a/Tests/DiffractoKitParityTests/Scattering/ScatteringPinsTests.swift b/Tests/DiffractoKitParityTests/Scattering/ScatteringPinsTests.swift index 873f726..679369d 100644 --- a/Tests/DiffractoKitParityTests/Scattering/ScatteringPinsTests.swift +++ b/Tests/DiffractoKitParityTests/Scattering/ScatteringPinsTests.swift @@ -110,8 +110,6 @@ enum ScatteringFixtures { static let xrayNames = ["Au", "Si", "Mg", "beta_double_prime", "Cu3Au-occ", "WS2"] } -private func relErr(_ x: Double, _ y: Double, floor: Double) -> Double { abs(x - y) / max(abs(y), floor) } - private func descendingMembers(_ ms: [MillerIndex]) -> [[Int]] { ms.sorted { ($0.h, $0.k, $0.l) > ($1.h, $1.k, $1.l) }.map { [$0.h, $0.k, $0.l] } } diff --git a/Tests/DiffractoKitTestSupport/IndexFixtures.swift b/Tests/DiffractoKitTestSupport/IndexFixtures.swift index bb4f2a8..e9e960a 100644 --- a/Tests/DiffractoKitTestSupport/IndexFixtures.swift +++ b/Tests/DiffractoKitTestSupport/IndexFixtures.swift @@ -7,7 +7,6 @@ import Foundation import Testing import DiffractoCore import DiffractoScattering -import DiffractoGeometry /// Structure builders shared by this target's indexing tests (a small copy of DiffractoScatteringTests' Presets: a test /// target cannot import another). diff --git a/Tests/DiffractoOrientationTests/ACOMMatcherCallerAPITests.swift b/Tests/DiffractoOrientationTests/ACOMMatcherCallerAPITests.swift index 25340ba..2ad9d50 100644 --- a/Tests/DiffractoOrientationTests/ACOMMatcherCallerAPITests.swift +++ b/Tests/DiffractoOrientationTests/ACOMMatcherCallerAPITests.swift @@ -5,7 +5,6 @@ // against the existing CPU route (`match`, `matchAll(peaks:)`), which is the reference; nothing here changes a number. // -import DiffractoKitTestSupport import Foundation import Testing import simd diff --git a/Tests/DiffractoOrientationTests/ACOMMatcherTests.swift b/Tests/DiffractoOrientationTests/ACOMMatcherTests.swift index 212b367..2446bbb 100644 --- a/Tests/DiffractoOrientationTests/ACOMMatcherTests.swift +++ b/Tests/DiffractoOrientationTests/ACOMMatcherTests.swift @@ -8,7 +8,6 @@ // `ACOMTemplateLibrary.project`, and planted orientations against py4DSTEM's own match_single_pattern. // -import DiffractoKitTestSupport import Foundation import Testing import simd @@ -144,7 +143,7 @@ private func peaks(_ c: Pins.Case) -> [ACOMPeak] { private let appKeys = ["al", "mg", "mono"] -private func appLibrary(_ key: String, _ crystal: Pins.Crystal) throws -> ACOMTemplateLibrary { +private func appLibrary(_ crystal: Pins.Crystal) throws -> ACOMTemplateLibrary { let app = try #require(crystal.appRoute) let settings = ACOMTemplateSettings(zoneAxisCount: app.zoneAxisCount, excitation: .appCurvature(wavelengthAngstrom: crystal.wavelength)) @@ -168,7 +167,7 @@ struct ACOMAppRouteTests { /// The beam directions are the apps' fundamental-zone samples; the templates are their polar images and spots. @Test(arguments: appKeys) func zoneAxesTemplatesAndSpotsEqualTheTranscription(key: String) throws { let c = try #require(try fixture().crystals[key]) - let lib = try appLibrary(key, c) + let lib = try appLibrary(c) let app = try #require(c.appRoute) let axes = vectors(f8(app.axes)) #expect(lib.zoneAxes.count == axes.count) @@ -201,7 +200,7 @@ struct ACOMAppRouteTests { /// runner-up, the in-plane angle, the orientation matrix and (m-3m) the reduced Euler angles. @Test(arguments: appKeys) func matchesEqualTheTranscription(key: String) throws { let c = try #require(try fixture().crystals[key]) - let lib = try appLibrary(key, c) + let lib = try appLibrary(c) let matcher = try #require(ACOMMatcher(library: lib)) var worstScores = 0.0, worstScore = 0.0, worstMatrix = 0.0, worstPolar = 0.0 for (k, cs) in try #require(c.appRoute).cases.enumerated() { @@ -600,7 +599,7 @@ struct ACOMMetalTests { var worst: Float = 0, cases = 0 for key in appKeys { let c = try #require(try fixture().crystals[key]) - let lib = try appLibrary(key, c) + let lib = try appLibrary(c) let matcher = try #require(ACOMMatcher(library: lib)) guard matcher.isMetalAvailable else { return } let pinned = try #require(c.appRoute).cases diff --git a/Tests/DiffractoOrientationTests/OrientationMapAnalysisTests.swift b/Tests/DiffractoOrientationTests/OrientationMapAnalysisTests.swift index 3199f58..d104d44 100644 --- a/Tests/DiffractoOrientationTests/OrientationMapAnalysisTests.swift +++ b/Tests/DiffractoOrientationTests/OrientationMapAnalysisTests.swift @@ -1,4 +1,3 @@ -import DiffractoKitTestSupport import Testing import simd @testable import DiffractoOrientation diff --git a/Tests/DiffractoOrientationTests/OrientationResultTests.swift b/Tests/DiffractoOrientationTests/OrientationResultTests.swift index 01d168e..f2e1533 100644 --- a/Tests/DiffractoOrientationTests/OrientationResultTests.swift +++ b/Tests/DiffractoOrientationTests/OrientationResultTests.swift @@ -5,7 +5,6 @@ // lives with the pins; these are the closed forms. // -import DiffractoKitTestSupport import Testing import Foundation import simd diff --git a/Tests/DiffractoOrientationTests/OrientationSymmetryTests.swift b/Tests/DiffractoOrientationTests/OrientationSymmetryTests.swift index e9ba93d..286a656 100644 --- a/Tests/DiffractoOrientationTests/OrientationSymmetryTests.swift +++ b/Tests/DiffractoOrientationTests/OrientationSymmetryTests.swift @@ -1,4 +1,3 @@ -import DiffractoKitTestSupport import Foundation import Testing import simd diff --git a/Tests/DiffractoOrientationTests/PhaseVectorResolutionTests.swift b/Tests/DiffractoOrientationTests/PhaseVectorResolutionTests.swift index b8ef919..526e3f6 100644 --- a/Tests/DiffractoOrientationTests/PhaseVectorResolutionTests.swift +++ b/Tests/DiffractoOrientationTests/PhaseVectorResolutionTests.swift @@ -3,12 +3,9 @@ // Role: what the tolerances in Å⁻¹ mean on a particular detector. // -import DiffractoKitTestSupport import Testing import Foundation import simd -import DiffractoCore -import DiffractoScattering import DiffractoOrientation @Suite struct PhaseVectorResolutionTests {