Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions petab/v2/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,8 @@ def run(self, problem: Problem) -> ValidationIssue | None:
new_petab_ids = {
m.petab_id
for m in problem.mappings
# Ignore identity mappings used for annotation
if m.petab_id != m.model_id
# Ignore identity mappings and annotation-only rows
if m.model_id and m.petab_id != m.model_id
}
old_petab_ids = (
{c.id for c in problem.conditions}
Expand Down
8 changes: 8 additions & 0 deletions tests/v2/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ def test_check_mapping_table(uses_pysb):
check = CheckMappingTable()
assert check.run(problem) is None

# Valid: mapping table is used purely for annotation
# petabEntityId appears elsewhere in the problem
problem.add_mapping(petab_id="c1", model_id=None, name="Condition 1")
problem.add_condition("c1", p2="1")

check = CheckMappingTable()
assert check.run(problem) is None

# Invalid: petabEntityId is referenced in the model
pysb.SelfExporter.cleanup()
pysb_model_invalid = pysb.Model("test_model_invalid")
Expand Down
Loading