Skip to content

Conversation

@sgillies
Copy link
Member

@sgillies sgillies commented Feb 1, 2022

Also reformat.

Towards resolving #935 #1031

@sgillies sgillies added this to the 1.8.21 milestone Feb 1, 2022
@sgillies sgillies self-assigned this Feb 1, 2022
assert len(items) == len(records1)
for val_in, val_out in zip(records1, items):
assert test_equal(driver, val_in, val_out), "in: {val_in}, out: {val_out}".format(val_in=val_in,
val_out=val_out)
Copy link
Member Author

Choose a reason for hiding this comment

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

#935 and #1031 report test failures involving coordinate comparison. So I'm removing the feature comparisons. We are really only concerned about the counting of features here. The exact values can be driver/platform dependent.


c.writerecords(records1)

is_good = True
Copy link
Member Author

Choose a reason for hiding this comment

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

This complicated the test and made it hard to understand. I've tried to rewrite it without this flag.

with fiona.open(path, "a", driver=driver) as c:
c.writerecords(records2)
except Exception as exc:
log.exception("Caught exception in trying to append.")
Copy link
Member Author

Choose a reason for hiding this comment

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

Reduced the scope of the try/except block.

assert not is_good
with fiona.open(path, driver=open_driver) as collection:
assert collection.driver == driver
assert len(collection) == len(records1)
Copy link
Member Author

@sgillies sgillies Feb 1, 2022

Choose a reason for hiding this comment

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

I think this is the heart of it. If no new records were added and there was no other exception, the format does not support appending.

@sgillies
Copy link
Member Author

sgillies commented Feb 2, 2022

PCIDSK is a difficult vector format. It doesn't appear in https://gdal.org/drivers/vector/index.html and got a rewrite at 3.3.0. The driver in versions back to 2.1 seems to support append, at least in my more general rewrite of the tests, so I've adjusted the metadata.

@sgillies sgillies marked this pull request as ready for review February 2, 2022 00:20
@sgillies sgillies merged commit 6b7474f into maint-1.8 Feb 2, 2022
@sgillies sgillies deleted the drvsupport-test-generalize branch February 2, 2022 00:39
@mwtoews
Copy link
Member

mwtoews commented Feb 3, 2022

Re PCIDSK, see #1046 (comment) which was put into the master branch. I recall looking at the release notes for that GDAL release, but didn't see much for PCIDSK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants