Skip to content

Conversation

@Tim-Evans-Seequent
Copy link

@Tim-Evans-Seequent Tim-Evans-Seequent commented Mar 2, 2023

Replaces the block model classes with new ones that should be simpler, faster, and easier to understand. There is now a single top-level element with switchable gridding and optional sub-blocks, giving fewer smaller classes.

Also cleaned up some related and unrelated code and fixed a minor bug.

@classmethod
def deserialize(cls, value, trusted=False, strict=False, assert_valid=False, **kwargs):
schema = value.pop("schema", "")
def __lookup_class(cls, schema):
Copy link
Author

Choose a reason for hiding this comment

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

This fixes getting useless errors when a schema is not found.

ContinuousColormap,
NumericAttribute,
StringAttribute,
VectorAttribute,
Copy link
Author

Choose a reason for hiding this comment

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

Direct imports mean you get errors earlier when changing things, helping to avoid bugs in production.

disable = "consider-using-f-string"
disable = [
"consider-using-f-string",
"no-name-in-module",
Copy link
Author

Choose a reason for hiding this comment

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

PyLint kept marking this error when there was nothing wrong.

Copy link

@grantroch grantroch left a comment

Choose a reason for hiding this comment

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

Very minor things

Copy link
Collaborator

@ThomasMatern ThomasMatern left a comment

Choose a reason for hiding this comment

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

probably a merge conflict: test_doc_example.py should have been deleted but it's an empty file on this branch

@Tim-Evans-Seequent
Copy link
Author

I have made a bunch more changes to this, simplifying it down to one new top-level element with what I think is a better layout with in. This keeps common fields out of components and reduces the total number of classes. I have also fleshed out the documentation so everything should make sense now.

@Tim-Evans-Seequent Tim-Evans-Seequent merged commit a353b9a into master Mar 17, 2023
@Tim-Evans-Seequent Tim-Evans-Seequent deleted the block-models-v2 branch March 17, 2023 02:16
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.

5 participants