Skip to content

Issue #1861 inconsistent ipf, report file name in the log#1876

Merged
JoerivanEngelen merged 3 commits into
masterfrom
Issue_#1861_inconsistent_ipf
Jul 2, 2026
Merged

Issue #1861 inconsistent ipf, report file name in the log#1876
JoerivanEngelen merged 3 commits into
masterfrom
Issue_#1861_inconsistent_ipf

Conversation

@rleander73

Copy link
Copy Markdown
Contributor

Fixes #

Description

Checklist

  • [*] Links to correct issue
  • [-] Update changelog, if changes affect users
  • [*] PR title starts with Issue #nr, e.g. Issue #737
  • [*] Unit tests were added
  • [-] If feature added: Added/extended example
  • [-] If feature added: Added feature to API documentation
  • [-] If pixi.lock was changed: Ran pixi run generate-sbom and committed changes

@JoerivanEngelen JoerivanEngelen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I like the approach. And thanks for adding a test. There are a few typo's that I'd like to see fixed first before this is ready to be merged

Comment thread imod/formats/ipf.py Outdated
log_message = (
f"Inconsistent IPF: header states {ncol} columns,"
+ " first line of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"
+ " columns and {len(next(csv.reader([line])))} comma-delimited columns."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to add a "f" for a formatted string here

Suggested change
+ " columns and {len(next(csv.reader([line])))} comma-delimited columns."
+ f" columns and line {len(next(csv.reader([line])))} comma-delimited columns."

Comment thread imod/formats/ipf.py Outdated
if not has_expected_cols:
log_message = (
f"Inconsistent IPF: header states {ncol} columns,"
+ " first line of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to add a "f" for a formatted string here

Suggested change
+ " first line of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"
+ f" first line of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"

Comment thread imod/formats/ipf.py Outdated
if not has_expected_cols:
log_message = (
f"Inconsistent IPF: header states {ncol} columns,"
+ " first datablock of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to add a "f" for a formatted string here

Suggested change
+ " first datablock of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"
+ f" first datablock of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"

Comment thread imod/formats/ipf.py Outdated
log_message = (
f"Inconsistent IPF: header states {ncol} columns,"
+ " first datablock of file:\n{f.name} \ncontains {len(line.split())} whitespace-delimited"
+ " columns and {len(next(csv.reader([line])))} comma-delimited columns."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to add a "f" for a formatted string here

Suggested change
+ " columns and {len(next(csv.reader([line])))} comma-delimited columns."
+ f" columns and line {len(next(csv.reader([line])))} comma-delimited columns."

Comment thread imod/formats/ipf.py
log_message = (
f"Inconsistent IPF: header states {ncol} columns,"
+ f" first line of file [{f.name}] contains {len(line.split())} whitespace-delimited"
+ f" columns and {len(next(csv.reader([line])))} comma-delimited columns."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+ f" columns and {len(next(csv.reader([line])))} comma-delimited columns."
+ f" columns and line {len(next(csv.reader([line])))} comma-delimited columns."

Comment thread imod/tests/test_formats/test_ipf.py Outdated
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@JoerivanEngelen JoerivanEngelen added this pull request to the merge queue Jul 2, 2026
Merged via the queue into master with commit e535591 Jul 2, 2026
8 of 9 checks passed
@JoerivanEngelen JoerivanEngelen deleted the Issue_#1861_inconsistent_ipf branch July 2, 2026 13:03
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.

3 participants