arelle.ValidateDuplicateFacts¶
See COPYRIGHT.md for copyright information.
Module Contents¶
Classes¶
Functions¶
|
|
Returns whether the given facts are value-equal |
|
Given a list of concept/context/unit hash-equivalent facts, yields sublists of aspect-equal facts from this list. |
|
|
|
|
|
|
|
Given a list of facts in an instance, returns a list of lists of facts that are concept/context/unit hash-equivalent. Return unhashable facts in singleton lists. |
|
API¶
- class arelle.ValidateDuplicateFacts.DuplicateFactSet¶
- facts: list[arelle.ModelInstanceObject.ModelFact]¶
None
- areAllComplete() bool¶
- Returns:
Whether all facts in the set are complete duplicates of each other.
- areAllConsistent() bool¶
- Returns:
Whether all facts in the set are consistent duplicates of each other.
- areAllDecimalsEqual() bool¶
- Returns:
Whether all facts have matching decimals values.
- areAllValueEqual() bool¶
- Returns:
Whether all facts in this set are fact-value equal with each other.
- areAnyComplete() bool¶
- Returns:
Whether any facts in the set are complete duplicates of each other.
- areAnyConsistent() bool¶
- Returns:
Whether any facts in the set are consistent duplicates of each other.
- areAnyIncomplete() bool¶
- Returns:
Whether any facts in the set are not complete duplicates of each other.
- areAnyInconsistent() bool¶
- Returns:
Whether any facts in the set are not consistent duplicates of each other.
- areNumeric() bool¶
- Returns:
Whether the duplicate set consists of numeric facts.
- areWithinRoundingError() bool¶
- Returns:
Whether all fact values are within rounding error of each other.
- deduplicateCompleteSubsets() list[arelle.ModelInstanceObject.ModelFact]¶
- Returns:
A list of the first fact found for each unique decimals/value combination.
- deduplicateConsistentPairs() list[arelle.ModelInstanceObject.ModelFact]¶
First performs deduplication of complete duplicates, then removes from the remaining facts any fact that is consistent with a higher precision fact.
- Returns:
A subset of the facts where the fact of lower precision in every consistent pair has been removed.
- deduplicateConsistentSet() tuple[list[arelle.ModelInstanceObject.ModelFact], str | None]¶
- Returns:
If this set is numeric and fully consistent, a list containing only the highest-precision fact. Otherwise, deduplication of complete duplicates.
- getDecimals(fact: arelle.ModelInstanceObject.ModelFact) float | int | None¶
Prevents repeated calculation of inferred decimal values.
- Parameters:
fact
- Returns:
Retrieve cached inferred decimals value for the provided fact.
- getRange(fact: arelle.ModelInstanceObject.ModelFact) tuple[_decimal.Decimal, _decimal.Decimal]¶
Prevents repeated calculation of fact value ranges.
- Parameters:
fact
- Returns:
Retrieve cached range values for the provided fact.
- arelle.ValidateDuplicateFacts.doesSetHaveDuplicateType(duplicateFacts: arelle.ValidateDuplicateFacts.DuplicateFactSet, duplicateType: arelle.ValidateDuplicateFactsConst.DuplicateType) bool¶
- Parameters:
duplicateFacts
duplicateType
- Returns:
Whether the given duplicate fact set has any duplicates of the given type.
- arelle.ValidateDuplicateFacts.areFactsValueEqual(factA: arelle.ModelInstanceObject.ModelFact, factB: arelle.ModelInstanceObject.ModelFact) bool¶
Returns whether the given facts are value-equal
- Parameters:
factA
factB
- Returns:
True if the given facts are value-equal
- arelle.ValidateDuplicateFacts.getAspectEqualFacts(hashEquivalentFacts: list[arelle.ModelInstanceObject.ModelFact], includeSingles: bool, useLang: bool = True) collections.abc.Iterator[list[arelle.ModelInstanceObject.ModelFact]]¶
Given a list of concept/context/unit hash-equivalent facts, yields sublists of aspect-equal facts from this list.
- Parameters:
hashEquivalentFacts
includeSingles – Whether to include lists of single facts (with no duplicates).
- Returns:
Lists of aspect-equal facts.
- arelle.ValidateDuplicateFacts.getDeduplicatedFacts(modelXbrl: arelle.ModelXbrl.ModelXbrl, deduplicationType: arelle.ValidateDuplicateFactsConst.DeduplicationType) list[arelle.ModelInstanceObject.ModelFact]¶
- arelle.ValidateDuplicateFacts.getDuplicateFactSets(facts: list[arelle.ModelInstanceObject.ModelFact], includeSingles: bool) collections.abc.Iterator[arelle.ValidateDuplicateFacts.DuplicateFactSet]¶
- Parameters:
facts – Facts to find duplicate sets from.
includeSingles – Whether to include lists of single facts (with no duplicates).
- Returns:
Each set of duplicate facts from the given list.
- arelle.ValidateDuplicateFacts.getDuplicateFactSetsWithType(facts: list[arelle.ModelInstanceObject.ModelFact], duplicateType: arelle.ValidateDuplicateFactsConst.DuplicateType) collections.abc.Iterator[arelle.ValidateDuplicateFacts.DuplicateFactSet]¶
- Parameters:
facts – Facts to find duplicate sets from.
duplicateType – Type of duplicate to filter duplicate sets by.
- Returns:
Each set of duplicate facts from the given list of facts that contain the given duplicate type.
- arelle.ValidateDuplicateFacts.getFactValueEqualityKey(fact: arelle.ModelInstanceObject.ModelFact) arelle.ValidateDuplicateFactsConst.TypeFactValueEqualityKey¶
- Parameters:
fact
- Returns:
A key to be used for fact-value-equality comparison.
- arelle.ValidateDuplicateFacts.getHashEquivalentFactGroups(facts: list[arelle.ModelInstanceObject.ModelFact]) list[list[arelle.ModelInstanceObject.ModelFact]]¶
Given a list of facts in an instance, returns a list of lists of facts that are concept/context/unit hash-equivalent. Return unhashable facts in singleton lists.
- Parameters:
facts
- Returns:
List of hash-equivalent fact lists
- arelle.ValidateDuplicateFacts.logDeduplicatedFact(modelXbrl: arelle.ModelXbrl.ModelXbrl, fact: arelle.ModelInstanceObject.ModelFact) None¶
- arelle.ValidateDuplicateFacts.saveDeduplicatedInstance(modelXbrl: arelle.ModelXbrl.ModelXbrl, deduplicationType: arelle.ValidateDuplicateFactsConst.DeduplicationType, outputFilepath: str) None¶