Skip to content

Fix XER collection iteration, data mappings, and round-trip writes - #38

Open
hurtlovewow wants to merge 2 commits into
HassanEmam:masterfrom
hurtlovewow:agent/pyp6xer-bug-fixes
Open

Fix XER collection iteration, data mappings, and round-trip writes#38
hurtlovewow wants to merge 2 commits into
HassanEmam:masterfrom
hurtlovewow:agent/pyp6xer-bug-fixes

Conversation

@hurtlovewow

Copy link
Copy Markdown
Contributor

What changed

  • Fix repeated and nested iteration across collection classes (fixes Iterertors outputs works only for one cycle #32).
  • Allow the XER reader to accept fields larger than Python's default CSV limit (fixes field larger than field limit (131072) #15).
  • Correct TASKPRED project mapping and predecessor lookup behavior.
  • Isolate task relationship queries per Reader instance instead of using global state.
  • Correct resource, role, category, schedule-option, task, and assignment field mappings and collection lookups.
  • Parse ROLE records and preserve role/rate/resource-category tables during XER write/read round trips.
  • Harden DCMA14 analysis for empty schedules, missing dates, valid hard constraints, and zero-denominator percentages; remove debug output.
  • Add regression coverage for the above, including existing floating-point lag_hr_cnt behavior.

Root causes

The collection iterators retained mutable cursor state between iterations; the reader relied on the CSV module's 131,072-character default field limit; several model constructors and find_by_id() methods contained copy/paste column or identifier errors; and some parsed XER tables were omitted by the writer. DCMA14 also divided by zero and compared dates when one side was missing.

Validation

  • pytest -q — 44 passed
  • python3 -m compileall -q xerparser tests
  • git diff --check

The feature requests for activity-relationship editing (#7), DCMA-14 visualisation (#10), and EVA/CPI/SPI charts (#13) are intentionally not included in this bug-fix PR.

@HassanEmam
HassanEmam marked this pull request as ready for review August 19, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Iterertors outputs works only for one cycle field larger than field limit (131072)

1 participant