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

API(fields): turn spin weight into a class property #93

Merged
merged 2 commits into from
Jan 1, 2024
Merged

Conversation

ntessore
Copy link
Contributor

@ntessore ntessore commented Jan 1, 2024

Turn the spin weight of Field subclasses from an __init__() keyword into a metaclass keyword. This removes the need for a trivial __init__() override in subclasses.

By default, the spin weight is undefined. If an undefined spin weight is obtained via the default .spin property, a ValueError is raised.

If necessary, Field subclasses can override the default .spin property to implement dynamic, instance-based spin weights.

Closes: #92
Closes: #51

@ntessore ntessore merged commit ef16490 into main Jan 1, 2024
6 checks passed
@ntessore ntessore deleted the pr-92 branch January 1, 2024 21:55
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.

Make spin weight a class property Turn ComplexMap-derived maps into proper subclasses
1 participant