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

Update to Grain.stack_grains per aimsgb deprecation warning #67

Merged
merged 4 commits into from
Sep 11, 2023

Conversation

liamhuber
Copy link
Member

Along with some signature and docstring updates.

Closes #65

Along with some signature and docstring updates
@jan-janssen
Copy link
Member

I can confirm that the warning message disappeared. So the changes fixed the issue.

Still I am wondering how we want to handle these kind of user facing API changes in the future. Should we release a new major version X.0.0 or at least a new minor version 0.X.0 ?

Comment on lines +52 to +57
vacuum=0.0,
gap=0.0,
delete_layer="0b0t0b0t",
tol=0.25,
to_primitive=False,
add_if_dist=None,
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to change the order of the arguments?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not necessary, but beneficial.

Previously the arguments were GrainBoundary.__init__ args, then an arbitrary mixture of GrainBoudary.__init__ and GrainBoundary.build_gb kwargs. This rationalizes things so that it's GrainBoundary.__init__ args, GrainBoundary.__init__ kwargs, Grain.stack_grains kwargs, then deprecated kwargs, with user-facing kwargs appearing in the same order as they do in the underlying library.

Since we need to change the signature anyways to handle the new kwarg and the renamed kwarg, I thought we might as well tighten the API up at the same time.

@liamhuber
Copy link
Member Author

Still I am wondering how we want to handle these kind of user facing API changes in the future. Should we release a new major version X.0.0 or at least a new minor version 0.X.0 ?

Yeah, this is a good thought. On google I found the recommendation:

MAJOR is incremented when you make breaking API changes.
MINOR is incremented when you add new functionality without breaking the existing API or functionality.
PATCH is incremented when you make backwards-compatible bug fixes.

In this case we only re-order existing keyword arguments and introduce a new one and a newly-named one (the deprecated keyword still works), so I would claim this falls under "without breaking the existing API" such that minor is sufficient. If you instead think that the re-ordering is sufficient to warrant a major bump I would be content with that too.

Copy link
Member

@jan-janssen jan-janssen 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

@liamhuber liamhuber merged commit 7c95387 into main Sep 11, 2023
10 checks passed
@liamhuber liamhuber deleted the update_aimsgb branch September 12, 2023 17:41
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.

Update aimsgb - The build_gb method is deprecated.
2 participants