Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add roundtrip test for model files #1007

Merged
merged 5 commits into from
Feb 9, 2024
Merged

Add roundtrip test for model files #1007

merged 5 commits into from
Feb 9, 2024

Conversation

visr
Copy link
Member

@visr visr commented Jan 30, 2024

Fixes #682. It was already fixed, but this ensures it with an extra test.

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Seems like tests are still failing

@visr
Copy link
Member Author

visr commented Jan 30, 2024

The binary diff on the database is probably too brittle. It would be more convenient to use sqldiff, which gives:

❯ sqldiff 1\database.gpkg 2\database.gpkg
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.855Z' WHERE rowid=1;
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.874Z' WHERE rowid=2;
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.891Z' WHERE rowid=3;
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.902Z' WHERE rowid=4;
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.911Z' WHERE rowid=5;
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.926Z' WHERE rowid=6;
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.937Z' WHERE rowid=7;
UPDATE gpkg_contents SET last_change='2024-01-30T09:47:02.947Z' WHERE rowid=8;

I cannot seem to get that tool from conda-forge though.

I wonder why Python 3.10 and 3.12 are different though, only on Windows.

Comment on lines 239 to 244
def nodes(self):
return {
k: getattr(self, k)
for k in self.model_fields.keys()
if isinstance(getattr(self, k), NodeModel)
if isinstance(getattr(self, k), NodeModel) and k != "network"
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I left out the network since it really isn't a node, and is such a different beast that it usually needs to be handled separately from the nodes.

@visr visr requested a review from Hofer-Julian February 9, 2024 16:57
@visr
Copy link
Member Author

visr commented Feb 9, 2024

This now compares the DataFrames rather than the GeoPackage bytes.

@Hofer-Julian Hofer-Julian merged commit 88f6fde into main Feb 9, 2024
20 of 21 checks passed
@Hofer-Julian Hofer-Julian deleted the stability branch February 9, 2024 17:36
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.

stability of node and edge IDs
2 participants