Skip to content

Commit c699e45

Browse files
committed
made some cross-column consistency checks dependent on the Poseidon version
1 parent 7132fd9 commit c699e45

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Poseidon/Janno.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ readJannoFileRow pv mandatoryCols jannoPath (lineNumber, row) = do
499499
logWarning $ "Value anomaly in " ++ jannoPath ++ " in line " ++ renderLocation ++ ": "
500500
mapM_ logWarning inspectRes
501501
-- cross-column checks
502-
let (errOrJannoRow, warnings) = W.runWriter (E.runExceptT (checkJannoRowConsistency jannoRow))
502+
let (errOrJannoRow, warnings) = W.runWriter (E.runExceptT (checkJannoRowConsistency pv jannoRow))
503503
mapM_ (logWarning . renderWarning) warnings
504504
-- return result
505505
case errOrJannoRow of
@@ -526,16 +526,16 @@ checkIndividualUnique (JannoRows rows) = length rows == length (nub $ map jPosei
526526

527527
-- Row-wise .janno consistency checks
528528

529-
checkJannoRowConsistency :: JannoRow -> RowLog JannoRow
530-
checkJannoRowConsistency x =
529+
checkJannoRowConsistency :: PoseidonVersion -> JannoRow -> RowLog JannoRow
530+
checkJannoRowConsistency pv x =
531531
return x
532532
>>= checkMandatoryStringNotEmpty
533-
>>= checkAlternativeIDsConsistent
533+
>>= (if asVersion pv >= makeVersion [3,0,0] then checkAlternativeIDsConsistent else return)
534534
>>= checkC14ColsConsistent
535535
>>= checkContamColsConsistent
536536
>>= checkRelationColsConsistent
537-
>>= checkCulturalEraConsistent
538-
>>= checkArchaeologicalCultureConsistent
537+
>>= (if asVersion pv >= makeVersion [3,0,0] then checkCulturalEraConsistent else return)
538+
>>= (if asVersion pv >= makeVersion [3,0,0] then checkArchaeologicalCultureConsistent else return)
539539

540540
checkMandatoryStringNotEmpty :: JannoRow -> RowLog JannoRow
541541
checkMandatoryStringNotEmpty x =

0 commit comments

Comments
 (0)